On Aug 18, 2009, at 8:28 AM, Ninad Raut wrote:

Hi,
I want to count the words between two significant words like "shell" and "petroleum". Or want to write a query to find all the documents where the content has "shell" and "petroleum" in close proximity of less than 10 words
between them.
Can such quries be created in Solr?

Yes, this is known as a "sloppy" phrase query. Using Solr's standard query parser, a query of "some phrase" within quotes makes an exact phrase query. Using "some words"~10 matches when the field has those words within that distance of term positions.

        Erik

Reply via email to