Parsing of rq queries in LTR

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Parsing of rq queries in LTR

Binoy Dalal
Hi,
For an LTR query, is there any way of checking how the `rq` is being
parsed? or specifically how the `efi` queries are treated?

For e.g. let's say my `rq` looks like this:
"rq":"{!ltr model=my_efi_model efi.text=my car}"

And my corresponding feature is:
SolrFeature [name=my_efi, params={q={!field f=efi_field}${text}}]

I want to see how the `my_efi` feature processes the query `q={!field
f=efi_field}${text}`.
Does it do something like `efi_field:my efi_field:car` or `efi_field=my
default_field=car` etc.

The debug query option does not provide this information and the solr logs
don't record the execution of queries made for feature value calculation.

Any inputs are much appreciated.
--
Regards,
Binoy Dalal
Reply | Threaded
Open this post in threaded view
|

RE: Parsing of rq queries in LTR

Brian Yee-2
I have a similar question. I performing my feature extraction with the following:

fl= [features+efi.query=bakeware 3-piece set]

I'm pretty sure the dash is causing my query to error. But I'm also not sure how the spaces impacts the efi param. I tried putting the term in quotes, but that does not work.

--Brian

-----Original Message-----
From: Binoy Dalal [mailto:[hidden email]]
Sent: Wednesday, October 11, 2017 10:51 AM
To: SOLR users group <[hidden email]>
Subject: Parsing of rq queries in LTR

Hi,
For an LTR query, is there any way of checking how the `rq` is being parsed? or specifically how the `efi` queries are treated?

For e.g. let's say my `rq` looks like this:
"rq":"{!ltr model=my_efi_model efi.text=my car}"

And my corresponding feature is:
SolrFeature [name=my_efi, params={q={!field f=efi_field}${text}}]

I want to see how the `my_efi` feature processes the query `q={!field f=efi_field}${text}`.
Does it do something like `efi_field:my efi_field:car` or `efi_field=my default_field=car` etc.

The debug query option does not provide this information and the solr logs don't record the execution of queries made for feature value calculation.

Any inputs are much appreciated.
--
Regards,
Binoy Dalal
Reply | Threaded
Open this post in threaded view
|

RE: Parsing of rq queries in LTR

alessandro.benedetti
I don't think this is actually that much related to LTR Solr Feature.
In the Solr feature I see you specify a query with a specific query parser
(field).
Unless there is a bug in the SolrFeature for LTR, I expect the query parser
you defined to be used[1].

This means :

"rawquerystring":"{!field f=full_name}alessandro benedetti",
"querystring":"{!field f=full_name}alessandro benedetti",
"parsedquery":"PhraseQuery(full_name:\"alessandro benedetti\")",
"parsedquery_toString":"full_name:\"alessandro benedetti\"",

In relation to multi term EFI, you need to pass
efi.example='term1 term2' .
If not just one term will be passed as EFI.[2]
This is more likely to be your problem.
I don't think the dash should be relevant at all

[1]
https://lucene.apache.org/solr/guide/6_6/other-parsers.html#OtherParsers-FieldQueryParser
[2] https://issues.apache.org/jira/browse/SOLR-11386




-----
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director
Sease Ltd. - www.sease.io
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director
Sease Ltd. - www.sease.io
Reply | Threaded
Open this post in threaded view
|

Re: Parsing of rq queries in LTR

Michael Alcorn
It turns out my last comment on that Jira was mistaken. Multi-term EFI
arguments still exhibit unexpected behavior. Binoy is trying to help me
figure out what the issue is. I plan on updating the Jira once we've
figured out the problem.

On Thu, Oct 12, 2017 at 3:41 AM, alessandro.benedetti <[hidden email]>
wrote:

> I don't think this is actually that much related to LTR Solr Feature.
> In the Solr feature I see you specify a query with a specific query parser
> (field).
> Unless there is a bug in the SolrFeature for LTR, I expect the query parser
> you defined to be used[1].
>
> This means :
>
> "rawquerystring":"{!field f=full_name}alessandro benedetti",
> "querystring":"{!field f=full_name}alessandro benedetti",
> "parsedquery":"PhraseQuery(full_name:\"alessandro benedetti\")",
> "parsedquery_toString":"full_name:\"alessandro benedetti\"",
>
> In relation to multi term EFI, you need to pass
> efi.example='term1 term2' .
> If not just one term will be passed as EFI.[2]
> This is more likely to be your problem.
> I don't think the dash should be relevant at all
>
> [1]
> https://lucene.apache.org/solr/guide/6_6/other-parsers.html#OtherParsers-
> FieldQueryParser
> [2] https://issues.apache.org/jira/browse/SOLR-11386
>
>
>
>
> -----
> ---------------
> Alessandro Benedetti
> Search Consultant, R&D Software Engineer, Director
> Sease Ltd. - www.sease.io
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>
Reply | Threaded
Open this post in threaded view
|

Re: Parsing of rq queries in LTR

Michael Alcorn
I believe I've discovered a workaround. If you use:

    {
        "store": "redhat_efi_feature_store",
        "name": "case_description_issue_tfidf",
        "class": "org.apache.solr.ltr.feature.SolrFeature",
        "params": {
            "q":"{!dismax qf=text_tfidf}${text}"
        }
    }

instead of:

    {
        "store": "redhat_efi_feature_store",
        "name": "case_description_issue_tfidf",
        "class": "org.apache.solr.ltr.feature.SolrFeature",
        "params": {
            "q": "{!field f=issue_tfidf}${case_description}"
        }
    }

you can then use single quotes to incorporate multi-term arguments as
Alessandro suggested. I've added this information to the Jira.

On Thu, Oct 12, 2017 at 9:10 AM, Michael Alcorn <[hidden email]> wrote:

> It turns out my last comment on that Jira was mistaken. Multi-term EFI
> arguments still exhibit unexpected behavior. Binoy is trying to help me
> figure out what the issue is. I plan on updating the Jira once we've
> figured out the problem.
>
> On Thu, Oct 12, 2017 at 3:41 AM, alessandro.benedetti <
> [hidden email]> wrote:
>
>> I don't think this is actually that much related to LTR Solr Feature.
>> In the Solr feature I see you specify a query with a specific query parser
>> (field).
>> Unless there is a bug in the SolrFeature for LTR, I expect the query
>> parser
>> you defined to be used[1].
>>
>> This means :
>>
>> "rawquerystring":"{!field f=full_name}alessandro benedetti",
>> "querystring":"{!field f=full_name}alessandro benedetti",
>> "parsedquery":"PhraseQuery(full_name:\"alessandro benedetti\")",
>> "parsedquery_toString":"full_name:\"alessandro benedetti\"",
>>
>> In relation to multi term EFI, you need to pass
>> efi.example='term1 term2' .
>> If not just one term will be passed as EFI.[2]
>> This is more likely to be your problem.
>> I don't think the dash should be relevant at all
>>
>> [1]
>> https://lucene.apache.org/solr/guide/6_6/other-parsers.html#
>> OtherParsers-FieldQueryParser
>> [2] https://issues.apache.org/jira/browse/SOLR-11386
>>
>>
>>
>>
>> -----
>> ---------------
>> Alessandro Benedetti
>> Search Consultant, R&D Software Engineer, Director
>> Sease Ltd. - www.sease.io
>> --
>> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>>
>
>