I'll buy that book :)

Does this work with mutli-word terms?

(common lisp or assembly language)
(programming or coding or development)


I tried:

{!surround}(common lisp OR assembly language) W (programming)

but that returns a parse error.

Putting quotes around the multi-word terms parses but returns 0 results

{!surround}("common lisp" OR "assembly language") W (programming)


On Tue, May 21, 2013 at 8:32 AM, Jack Krupansky <j...@basetechnology.com>wrote:

> I'll make sure to include that specific example in the new Solr book.
>
>
> -- Jack Krupansky
>
> -----Original Message----- From: Mike Hugo
> Sent: Tuesday, May 21, 2013 12:29 AM
> To: solr-user@lucene.apache.org
> Subject: Re: Expanding sets of words
>
>
> Fantastic!  Thanks!
>
>
> On Mon, May 20, 2013 at 11:21 PM, Jack Krupansky <j...@basetechnology.com>
> **wrote:
>
>  Yes, with the Solr "surround" query parser:
>>
>> q=(java OR groovy OR scala) W (programming OR coding OR development)
>>
>> BUT... there is the caveat that the surround query parser does no
>> analysis. So, maybe you need "Java OR java" etc. Or, if you know that the
>> index is lower case.
>>
>> Try this dataset:
>>
>> curl 
>> http://localhost:8983/solr/****collection1/update?commit=true<http://localhost:8983/solr/**collection1/update?commit=true>
>> **<http://localhost:8983/solr/**collection1/update?commit=true<http://localhost:8983/solr/collection1/update?commit=true>
>> **>-H 'Content-type:application/csv' -d '
>>
>> id,features
>> doc-1,java coding
>> doc-2,java programming
>> doc-3,java development
>> doc-4,groovy coding
>> doc-5,groovy programming
>> doc-6,groovy development
>> doc-7,scala coding
>> doc-8,scala programming
>> doc-9,scala development
>> doc-10,c coding
>> doc-11,c programming
>> doc-12,c development
>> doc-13,java language
>> doc-14,groovy language
>> doc-15,scala language'
>>
>> And try these commands:
>>
>> curl 
>> "http://localhost:8983/solr/****select/?q=(java+OR+scala)+W+**<http://localhost:8983/solr/**select/?q=(java+OR+scala)+W+**>
>> programming\<http://localhost:**8983/solr/select/?q=(java+OR+**
>> scala)+W+programming%5C<http://localhost:8983/solr/select/?q=(java+OR+scala)+W+programming%5C>
>> >
>> &df=features&defType=surround&****indent=true"
>>
>> curl 
>> "http://localhost:8983/solr/****select/<http://localhost:8983/solr/**select/>
>> <http://localhost:8983/**solr/select/<http://localhost:8983/solr/select/>
>> >
>> ?\
>> q=(java+OR+scala)+W+(****programming+OR+coding)\
>> &df=features&defType=surround&****indent=true"
>>
>> curl 
>> "http://localhost:8983/solr/****select/\<http://localhost:8983/solr/**select/%5C>
>> <http://localhost:**8983/solr/select/%5C<http://localhost:8983/solr/select/%5C>
>> >
>> ?q=(java+OR+groovy+OR+scala)+****W+(programming+OR+coding+OR+***
>> *development)\
>> &df=features&defType=surround&****indent=true"
>>
>>
>> The LucidWorks Search query parser also supports NEAR, BEFORE, and AFTER
>> operators, in conjunction with OR and "-" to generate span queries:
>>
>> q=(java OR groovy OR scala) BEFORE:0 (programming OR coding OR
>> development)
>>
>> -- Jack Krupansky
>>
>> -----Original Message----- From: Mike Hugo
>> Sent: Monday, May 20, 2013 11:42 PM
>> To: solr-user@lucene.apache.org
>> Subject: Expanding sets of words
>>
>>
>> Is there a way to query for combinations of two sets of words?  For
>> example, if I had
>>
>> (java or groovy or scala)
>> (programming or coding or development)
>>
>> Is there a query parser that, at query time, would expand that into
>> combinations like
>>
>> java programming
>> groovy programming
>> scala programming
>> java coding
>> java development
>> ....
>> etc etc etc
>>
>> Thanks!
>>
>> Mike
>>
>>
>

Reply via email to