I have this question regarding Lucene.
I have a form, and I get text from it, and I want to perform a full text search in several fields. Suppose I get the text "textToLook" from the input.
I have a Lucene Analyzer with several filters. One of them is lowerCaseFilter, so when I create the index, the words will decrease.
Imagine I want to search two fields, field1 and field2, so the lucene query will look something like this (note that "textToLook" is now "texttolook"):
field1: texttolook* field2:texttolook*
In my class, I have something like this to create a query. I work when there is no template.
String text = "textToLook";
String[] fields = {"field1", "field2"};
Analyzer analyzer = fullTextEntityManager.getSearchFactory().getAnalyzer("customAnalyzer");
MultiFieldQueryParser parser = new MultiFieldQueryParser(fields, analyzer);
org.apache.lucene.search.Query queryTextoLibre = parser.parse(text);
Using this code, the query will look like this:
field1: texttolook field2:texttolook
but if I set the text to textToLook *, I get
field1: texttolook* field2:texttolook*
, .
- lucene :
" , , , , lowercasing"
, , .
, , , , "*", Query MultiFieldQueryParser. "textToLower", , , "texttolower". "textotolower *".
? ? ?