solr, finding preceding trailing/terms for a given term
Is there a way in 开发者_开发问答SOLR, with termquery, searchquery or other magic, to find the most preceding (or trailing) terms, for a given term x?
If I'm understanding you correctly you're wanting to do something like this:
Indexed data: "Jack climbed up the hill"
If you search for "climbed", you want to know that "Jack" and "up" are preceding and trailing the term you searched for?
It seems like you could rudimentarily do this by turning on highlighting, and then on your schema, don't stem (well you can stem but it's not going to highlight), and then process each result that has a highlight to figure out the terms you're looking for.
精彩评论