You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Sundeep T <su...@gmail.com> on 2017/04/26 04:42:38 UTC

Is there a way to specify word position in solr search query on text fields?

Hello,

We have a text field in our schema that is indexed using the
StandardTokenizerFactory. We have set omitPositions= false, so that
positional information of individual tokens is also included in the index
data.

Question is if there is a way to construct a query in which we can specify
the position information as well?

For example, if I have two text strings like "foo bar" and "bar foo".

Now, i want to find strings which only start with "foo". Is there a way to
do that? Basically, looking whether something like position=0 for the word
"foo" can be specified as a parameter in the query

Thanks
Sundeep