Lucene Query Programming - Lucene

What is Lucene Query Programming?

We have seen in before division Lucerne - Search Operation, Lucerne use Index Searcher to make searches and it uses the Query entity formed by Query Parser as the input. In this stage, we are going to discuss different kind of Query substance and the different ways to construct them programmatically. Creating changed types of Query entity gives manage on the kind of search to be made.

Consider a container of Advanced Search, provide by a lot of applications where users are given many options to impound the search grades. By Query programming, we can realize the same very simply.

Following is the directory of Query types that we'll consider in due path.

S.No. Class & Description
1 TermQuery
This class acts as a core component which creates/updates indexes during the indexing process.
2 TermRangeQuery
TermRangeQuery is used when a range of textual terms are to be searched.
3 PrefixQuery
PrefixQuery is used to match documents whose index starts with a specified string.
4 BooleanQuery
BooleanQuery is used to search documents which are result of multiple queries usingAND, ORorNOToperators.
5 PhraseQuery
Phrase query is used to search documents which contain a particular sequence of terms.
6 WildCardQuery
WildcardQuery is used to search documents using wildcards like '*' for any character sequence,? matching a single character.
7 FuzzyQuery
FuzzyQuery is used to search documents using fuzzy implementation that is an approximate search based on the edit distance algorithm.
8 MatchAllDocsQuery
MatchAllDocsQuery as the name suggests matches all the documents.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Lucene Topics