0
votes

I have lucene indexes indexed using StandardAnalyzer. The index consist of a value "AND". When I try to search for the field value AND using MultiFieldQueryParser, the search is resulting in error.

EG: field1:* AND field2:AND

filed1:* AND field:"AND"

I have tried escape but is that is escaping the field value. I have aslo tried in double coutes("AND"). But could not succed in getting correct value.

Any advice in this regard would be helpful.

Thanks in advance.

1

1 Answers

0
votes

I suspect that there are probably two issues in play here:

  • Query syntax, I think you'll get further by putting the "and" in lower case. Boolean terms in the standard query parser must be in upper case. Anyway, given that one of the steps of the standard analyser is to drop case sensitivity, this shouldn't be an issue
  • The next problem is stop words: I suspect that "and" is excluded from the set of analysed terms by the standard analysers stop word list. You could get around this by using a different stop word list with the standard analyser that doesn't exclude "and" as a term.

Good luck,