Yes, slide 11 of first presentation and slide 35 of the second one do
show that the _query or {!} can be used multiple types in one top
query. The other slides/links do not, they only show it once.

So, I think a lot of people may be missing that power. I suspect it's
a bit like using the bbox search to see who is available to work the
night shift example.

In any case, I put it on my blog todo list. I already have a Solr
example for it (https://gist.github.com/arafalov/5e04884e5aefaf46678c),
as well as - for those curious - an ElasticSearch counter example:
https://gist.github.com/mattweber/9cb7d0d9fc112dffa8de (not tested).

Regards,
  Alex.
Personal website: http://www.outerthoughts.com/
Current project: http://www.solr-start.com/ - Accelerating your Solr proficiency


On Thu, Jul 10, 2014 at 8:42 PM, Erik Hatcher <erik.hatc...@gmail.com> wrote:
> Yeah, using multiple _query_’s has always been possible.  _query_ is just a 
> special field name that gets interpreted specially.  Same with _val_ for 
> function queries.
>
> It’s a feature that’s been leveraged and “documented” (by way of presentation 
> materials and blogs, at least) such as:
>
>   - http://www.slideshare.net/erikhatcher/solr-query-parsing (slides 6 and 11)
>   - http://www.slideshare.net/erikhatcher/solr-black-belt-preconference 
> (slide 35)
>   - http://searchhub.org/2009/03/31/nested-queries-in-solr/
>
> My favorite example of this is Stanford’s library advanced search - 
> http://searchworks.stanford.edu/advanced - where it uses a different dismax 
> “sub”query for each field (which actually corresponds to multiple underlying 
> Solr fields each).
>
> Best,
>         Erik
>
>
>
> On Jul 10, 2014, at 12:19 AM, Alexandre Rafalovitch <arafa...@gmail.com> 
> wrote:
>
>> Well, even JIRA and the release notes concentrates on a replacement of
>> _query_ with {!}. But not about having multiple of them. Was it
>> possible to have multiple _query_ segments in one 'q' query? I was not
>> aware of that either.
>>
>> Basically, I am suggesting that somebody who knows this in depth
>> should write an article. I feel it is a powerful feature of Solr, but
>> I was even hesitant to use it in my own config because all the online
>> examples were for a single-use.
>>
>> Regards,
>>   Alex.
>> Personal website: http://www.outerthoughts.com/
>> Current project: http://www.solr-start.com/ - Accelerating your Solr 
>> proficiency
>>
>>
>> On Thu, Jul 10, 2014 at 11:18 AM, Jack Krupansky
>> <j...@basetechnology.com> wrote:
>>> From the Solr 4.1 release notes:
>>>
>>> * Solr QParsers may now be directly invoked in the lucene query syntax
>>> via localParams and without the _query_ magic field hack.
>>> Example: foo AND {!term f=myfield v=$qq}
>>>
>>> -- Jack Krupansky
>>>
>>> -----Original Message----- From: Jack Krupansky
>>> Sent: Thursday, July 10, 2014 12:14 AM
>>>
>>> To: solr-user@lucene.apache.org
>>> Subject: Re: Complement of {!join}
>>>
>>> I think this is the Jira that implemented that feature:
>>> SOLR-4093 - localParams syntax for standard query parser
>>> https://issues.apache.org/jira/browse/SOLR-4093
>>>
>>> Yeah, I don't think this is fully documented anywhere, other than the Jira
>>> and the patch itself.
>>>
>>> I think I had finished my query parser doc in my e-book before 4.1 came out.
>>> This was the point where the "divorce" between the Lucene and Solr query
>>> parsers took place, because the feature needed to be added to the query
>>> parser grammar, but the Lucene guys objected to this "Solr feature."
>>>
>>> -- Jack Krupansky
>>>
>>> -----Original Message----- From: Alexandre Rafalovitch
>>> Sent: Wednesday, July 9, 2014 9:10 PM
>>> To: solr-user@lucene.apache.org
>>> Subject: Re: Complement of {!join}
>>>
>>> Ok, so cannot be eDisMax at the top.
>>>
>>> However, the point I really am trying to make does not seem to be in
>>> those links. All the examples of local parameters I have seen use them
>>> at the start of the query as a standalone component. I haven't seen
>>> examples where a query string contains several of them together and
>>> uses different query parsers. The only example I do remember seeing
>>> multiple query parsers used together was when each one of them was
>>> done separately in 'fq' clauses.
>>>
>>> Additionally, even now I don't know how the end of the content after
>>> the local parameter closing brace is determined. I used line breaks
>>> for my example, also (brackets) seem to work. But I don't remember
>>> seeing the exact rules.
>>>
>>> So, I still think the world could benefit from a very visible example
>>> showing multi-clause query with different sub-clauses using different
>>> query parsers. Perhaps even on that same linked page on Wiki. And/Or a
>>> presentation on "Did you know this about Solr?" at the next big
>>> conference.
>>>
>>> Regards,
>>>  Alex.
>>>
>>> Personal website: http://www.outerthoughts.com/
>>> Current project: http://www.solr-start.com/ - Accelerating your Solr
>>> proficiency
>>>
>>>
>>> On Thu, Jul 10, 2014 at 7:53 AM, Chris Hostetter
>>> <hossman_luc...@fucit.org> wrote:
>>>>
>>>> :
>>>> : Somebody (with more knowledge) should write up an in-depth article on
>>>> : this issue and whether the parent parser has to be default (lucene) or
>>>> : whatever.
>>>>
>>>> It's a feature of Solr's standard query parser...
>>>>
>>>> https://cwiki.apache.org/confluence/display/solr/Query+Syntax+and+Parsing
>>>> https://cwiki.apache.org/confluence/display/solr/The+Standard+Query+Parser
>>>>
>>>> https://cwiki.apache.org/confluence/display/solr/The+Standard+Query+Parser#TheStandardQueryParser-DifferencesbetweenLuceneQueryParserandtheSolrStandardQueryParser
>>>>
>>>>
>>>>
>>>> -Hoss
>>>> http://www.lucidworks.com/
>>>
>>>
>

Reply via email to