Full Text Search in GeneXus applications
The following article was published recently in iMasters Brazil by Bruno Macedo, where he writes about the importance of functionality in searching and the resource of FTS in GeneXus, available in the X version.
Nowadays, searching on the Internet is something basic for all users of the net. Number 1 “Google” is proof of that.
It is becoming ever more frequent for sites to offer a search field somewhere in the page. This functionality, which is something essential, facilitates much for users, and has much importance in their permanence within the site.
How can this search mechanism be implemented in applications? The search is often done in the databank, using SQL queries. There are cases where the developer resorts to LIKE operator, which causes significant loss of performance when there is too much data in the table.
This issue can be solved with the powerful resource of FTS (Full Text Search) offered by GeneXus X.
FTS Objective in the Applications
Full Text Search allows the users of the application to define their own specific search. The search will analyze:
• The database (only in Transactions defined as Business Components);
• Files filed in HD.
The objective of FTS is to find non-structured information such as text in comments fields, suggested among others. In general, they are texts entered by the user.
FTS in the KB
GeneXus also offers a powerful search engine that allows finding anything quickly within a Knowledge Base. It can do a search by informing a text or even by specifying values of properties of objects or of the knowledge base itself.
Based on complex algorithms, the search engine (FTS) of GeneXus will find what you are searching for, even if it has to examine the whole KB.
See more information on FTS at CommunityWiki.
FTS in the Application
As shown, FTS allows changing the way in which users browse through sites. There are two basic ways to browse: one is to go through links (a complicated way when we ignore the exact location of the link) and the other is to do a full text search in the whole site, with the purpose of reaching the desired link directly.
A very common situation in FTS is that where the user simply recalls some fact, such as "Was awarded the prize", "Requested loans" or "Total Invoice: 5,400", etc. This is where FTS starts functioning, for solving a search of this kind with traditional programming is not easy at all.
One of the search engines used in GeneXus is Apache Lucene. It allows indexing GeneXus Transactions defined as BC and files of the HTM, PDF types, Word documents or any other format from where text information can be extracted.
Apache Lucene, or just “Lucene”, is a searching software and an indexing API. This open code software was written in Java.
See more information on Apache Lucene at: http://lucene.apache.org/
Users may do their search in applications by:
• Searching all keywords typed in, for example: loan AND debt (including blank spaces between words is equivalent to the AND operator);
• Searching for exact texts, for example: interest reimbursement;
• Searching for at least one word, for example: credit OR debit;
• Searching by word group, for example: (asset OR purchase) AND NOT finance.
There are more searching options that depend on the search engine used.
Conclusions
FTS is a powerful and efficient resource implemented in the X version of GeneXus.
It is something that has become increasingly necessary in applications, due to the increased need for Google-like search for information.
The next article will consider the types of data available to work with FTS in GeneXus, and how to index files, including examples as usual.
We will be in touch again soon!
* Based on the article by Bruno Macedo published in iMasteres.
It is becoming ever more frequent for sites to offer a search field somewhere in the page. This functionality, which is something essential, facilitates much for users, and has much importance in their permanence within the site.
How can this search mechanism be implemented in applications? The search is often done in the databank, using SQL queries. There are cases where the developer resorts to LIKE operator, which causes significant loss of performance when there is too much data in the table.
This issue can be solved with the powerful resource of FTS (Full Text Search) offered by GeneXus X.
FTS Objective in the Applications
Full Text Search allows the users of the application to define their own specific search. The search will analyze:
• The database (only in Transactions defined as Business Components);
• Files filed in HD.
The objective of FTS is to find non-structured information such as text in comments fields, suggested among others. In general, they are texts entered by the user.
FTS in the KB
GeneXus also offers a powerful search engine that allows finding anything quickly within a Knowledge Base. It can do a search by informing a text or even by specifying values of properties of objects or of the knowledge base itself.
Based on complex algorithms, the search engine (FTS) of GeneXus will find what you are searching for, even if it has to examine the whole KB.
See more information on FTS at CommunityWiki.
FTS in the Application
As shown, FTS allows changing the way in which users browse through sites. There are two basic ways to browse: one is to go through links (a complicated way when we ignore the exact location of the link) and the other is to do a full text search in the whole site, with the purpose of reaching the desired link directly.
A very common situation in FTS is that where the user simply recalls some fact, such as "Was awarded the prize", "Requested loans" or "Total Invoice: 5,400", etc. This is where FTS starts functioning, for solving a search of this kind with traditional programming is not easy at all.
One of the search engines used in GeneXus is Apache Lucene. It allows indexing GeneXus Transactions defined as BC and files of the HTM, PDF types, Word documents or any other format from where text information can be extracted.
Apache Lucene, or just “Lucene”, is a searching software and an indexing API. This open code software was written in Java.
See more information on Apache Lucene at: http://lucene.apache.org/
Users may do their search in applications by:
• Searching all keywords typed in, for example: loan AND debt (including blank spaces between words is equivalent to the AND operator);
• Searching for exact texts, for example: interest reimbursement;
• Searching for at least one word, for example: credit OR debit;
• Searching by word group, for example: (asset OR purchase) AND NOT finance.
There are more searching options that depend on the search engine used.
Conclusions
FTS is a powerful and efficient resource implemented in the X version of GeneXus.
It is something that has become increasingly necessary in applications, due to the increased need for Google-like search for information.
The next article will consider the types of data available to work with FTS in GeneXus, and how to index files, including examples as usual.
We will be in touch again soon!
* Based on the article by Bruno Macedo published in iMasteres.