Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error=uk.co.flax.luwak.util.RewriteException #141

Open
nik9839 opened this issue Jun 14, 2017 · 1 comment
Open

error=uk.co.flax.luwak.util.RewriteException #141

nik9839 opened this issue Jun 14, 2017 · 1 comment

Comments

@nik9839
Copy link

nik9839 commented Jun 14, 2017

I have added a query- "plans to eat" in the monitor with id "query1-plans to eat", and my document has a substring plans to eat.
While iterating over the matches, this query gets matched but is unable to give the hit.
During debugging i get this

"Match(doc=doc-1,query=query1-plans to eat){error=uk.co.flax.luwak.util.RewriteException: Don't know how to rewrite PhraseQuery with holes or overlaps (position must increase by 1 each time but found term document:plans at position 0 followed by term document:eat at position 2)} "

I guess this problem is because of stop words.

The code i used is like this

for (HighlightsMatch docMatch : docMatches) {
Set hits = docMatch.getHits().get("document");
List phrasesMatched = new ArrayList();
String phrase = "";
int oldPosition = 0;
int newOffset = 0;
System.out.println("hit count for "+docMatch.getQueryId().split("---")[1]+" "+docMatch.getHitCount());
if(hits != null) {
.....some code
}
signalPhraseMap.put(docMatch.getQueryId(), phrasesMatched);
}

when the docMatch gets to "plans to eat" it is unable to give the hit.

@romseygeek
Copy link
Collaborator

SpanNearQuery actually has the ability to add defined gaps now, so it should be possible to handle stop words correctly. Do you want to work on a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants