Re: Solr learning to rank features question
haha.. all good! I'm trying to find my way there now too. On Wed, Sep 13, 2017, 17:01 Diego Ceccarelliwrote: > Hey man, how's life? > Are you at the conference? I'm going a the reception now, see you there in > case :) > > On 29 Aug 2017 12:10, "Brian Yee" wrote: > > > Thank you Diego! This works with some small changes. My feature ended up > > looking like this: > > > > { > > "name" : "FeatureA", > > "store" : "commonFeatureStore", > > "class" : "org.apache.solr.ltr.feature.SolrFeature", > > "params" : { > > "q" : "{!func}if(gt(ms(CutoffDate,NOW),0),exists(query({!v= > > PreZones:${zone}})),exists(query({!v=PostZones:${zone}})))" > > } > > }, > > > > On Tue, Aug 29, 2017 at 12:32 PM, Diego Ceccarelli < > > diego.ceccare...@gmail.com> wrote: > > > > > Hi Brian, > > > > > > The plugin doesn't allow you to express multiple function queries in > the > > > same feature. Maybe in this case you can express both the tw queries in > > one > > > unique function query, using the if function. > > > > > > Something like: > > > > > > "fq":"if(gt(ms(NOW,mydatefield),0,query(PreCutOffZones:${zone}), query( > > > PostCutOffZones:${zone}))" > > > > > > > > > (Function query documentation here: > > > https://cwiki.apache.org/confluence/display/solr/Function+Queries) > > > > > > Let me know if it works. > > > > > > Cheers, > > > Diego > > > > > > > > > > > > > > > > > > > > > > > > On Tue, Aug 29, 2017 at 5:47 PM, Brian Yee > wrote: > > > > > > > Hello, > > > > > > > > I have a somewhat complex solr filter query that I am hoping to turn > > > into a > > > > feature for learning to rank, but I am not sure if it's possible. I > > would > > > > like to OR two fq together for one of my features. I have a cutoff > date > > > and > > > > I need to check one field if NOW is before the cutoff, and a > different > > > > field if NOW is after the cutoff. Is this possible? > > > > > > > > Something to the effect of this: > > > > { > > > > "name" : "FeatureA", > > > > "store" : "commonFeatureStore", > > > > "class" : "org.apache.solr.ltr.feature.SolrFeature", > > > > "params" : { > > > > "fq" : [ > > > > "{!frange l=NOW}CutOffDate", > > > > "{!term f=PreCutOffZones}${zone}" > > > > ] > > > > OR > > > > "fq" : [ > > > > "{!frange u=NOW}CutOffDate", > > > > "{!term f=PostCutOffZones}${zone}" > > > > ] > > > > } > > > > }, > > > > > > > > Thank you! > > > > Brian Yee > > > > > > > > > >
Re: Solr learning to rank features question
Hey man, how's life? Are you at the conference? I'm going a the reception now, see you there in case :) On 29 Aug 2017 12:10, "Brian Yee"wrote: > Thank you Diego! This works with some small changes. My feature ended up > looking like this: > > { > "name" : "FeatureA", > "store" : "commonFeatureStore", > "class" : "org.apache.solr.ltr.feature.SolrFeature", > "params" : { > "q" : "{!func}if(gt(ms(CutoffDate,NOW),0),exists(query({!v= > PreZones:${zone}})),exists(query({!v=PostZones:${zone}})))" > } > }, > > On Tue, Aug 29, 2017 at 12:32 PM, Diego Ceccarelli < > diego.ceccare...@gmail.com> wrote: > > > Hi Brian, > > > > The plugin doesn't allow you to express multiple function queries in the > > same feature. Maybe in this case you can express both the tw queries in > one > > unique function query, using the if function. > > > > Something like: > > > > "fq":"if(gt(ms(NOW,mydatefield),0,query(PreCutOffZones:${zone}), query( > > PostCutOffZones:${zone}))" > > > > > > (Function query documentation here: > > https://cwiki.apache.org/confluence/display/solr/Function+Queries) > > > > Let me know if it works. > > > > Cheers, > > Diego > > > > > > > > > > > > > > > > On Tue, Aug 29, 2017 at 5:47 PM, Brian Yee wrote: > > > > > Hello, > > > > > > I have a somewhat complex solr filter query that I am hoping to turn > > into a > > > feature for learning to rank, but I am not sure if it's possible. I > would > > > like to OR two fq together for one of my features. I have a cutoff date > > and > > > I need to check one field if NOW is before the cutoff, and a different > > > field if NOW is after the cutoff. Is this possible? > > > > > > Something to the effect of this: > > > { > > > "name" : "FeatureA", > > > "store" : "commonFeatureStore", > > > "class" : "org.apache.solr.ltr.feature.SolrFeature", > > > "params" : { > > > "fq" : [ > > > "{!frange l=NOW}CutOffDate", > > > "{!term f=PreCutOffZones}${zone}" > > > ] > > > OR > > > "fq" : [ > > > "{!frange u=NOW}CutOffDate", > > > "{!term f=PostCutOffZones}${zone}" > > > ] > > > } > > > }, > > > > > > Thank you! > > > Brian Yee > > > > > >
Re: Solr learning to rank features question
Thank you Diego! This works with some small changes. My feature ended up looking like this: { "name" : "FeatureA", "store" : "commonFeatureStore", "class" : "org.apache.solr.ltr.feature.SolrFeature", "params" : { "q" : "{!func}if(gt(ms(CutoffDate,NOW),0),exists(query({!v= PreZones:${zone}})),exists(query({!v=PostZones:${zone}})))" } }, On Tue, Aug 29, 2017 at 12:32 PM, Diego Ceccarelli < diego.ceccare...@gmail.com> wrote: > Hi Brian, > > The plugin doesn't allow you to express multiple function queries in the > same feature. Maybe in this case you can express both the tw queries in one > unique function query, using the if function. > > Something like: > > "fq":"if(gt(ms(NOW,mydatefield),0,query(PreCutOffZones:${zone}), query( > PostCutOffZones:${zone}))" > > > (Function query documentation here: > https://cwiki.apache.org/confluence/display/solr/Function+Queries) > > Let me know if it works. > > Cheers, > Diego > > > > > > > > On Tue, Aug 29, 2017 at 5:47 PM, Brian Yeewrote: > > > Hello, > > > > I have a somewhat complex solr filter query that I am hoping to turn > into a > > feature for learning to rank, but I am not sure if it's possible. I would > > like to OR two fq together for one of my features. I have a cutoff date > and > > I need to check one field if NOW is before the cutoff, and a different > > field if NOW is after the cutoff. Is this possible? > > > > Something to the effect of this: > > { > > "name" : "FeatureA", > > "store" : "commonFeatureStore", > > "class" : "org.apache.solr.ltr.feature.SolrFeature", > > "params" : { > > "fq" : [ > > "{!frange l=NOW}CutOffDate", > > "{!term f=PreCutOffZones}${zone}" > > ] > > OR > > "fq" : [ > > "{!frange u=NOW}CutOffDate", > > "{!term f=PostCutOffZones}${zone}" > > ] > > } > > }, > > > > Thank you! > > Brian Yee > > >
Re: Solr learning to rank features question
Hi Brian, The plugin doesn't allow you to express multiple function queries in the same feature. Maybe in this case you can express both the tw queries in one unique function query, using the if function. Something like: "fq":"if(gt(ms(NOW,mydatefield),0,query(PreCutOffZones:${zone}), query( PostCutOffZones:${zone}))" (Function query documentation here: https://cwiki.apache.org/confluence/display/solr/Function+Queries) Let me know if it works. Cheers, Diego On Tue, Aug 29, 2017 at 5:47 PM, Brian Yeewrote: > Hello, > > I have a somewhat complex solr filter query that I am hoping to turn into a > feature for learning to rank, but I am not sure if it's possible. I would > like to OR two fq together for one of my features. I have a cutoff date and > I need to check one field if NOW is before the cutoff, and a different > field if NOW is after the cutoff. Is this possible? > > Something to the effect of this: > { > "name" : "FeatureA", > "store" : "commonFeatureStore", > "class" : "org.apache.solr.ltr.feature.SolrFeature", > "params" : { > "fq" : [ > "{!frange l=NOW}CutOffDate", > "{!term f=PreCutOffZones}${zone}" > ] > OR > "fq" : [ > "{!frange u=NOW}CutOffDate", > "{!term f=PostCutOffZones}${zone}" > ] > } > }, > > Thank you! > Brian Yee >
Solr learning to rank features question
Hello, I have a somewhat complex solr filter query that I am hoping to turn into a feature for learning to rank, but I am not sure if it's possible. I would like to OR two fq together for one of my features. I have a cutoff date and I need to check one field if NOW is before the cutoff, and a different field if NOW is after the cutoff. Is this possible? Something to the effect of this: { "name" : "FeatureA", "store" : "commonFeatureStore", "class" : "org.apache.solr.ltr.feature.SolrFeature", "params" : { "fq" : [ "{!frange l=NOW}CutOffDate", "{!term f=PreCutOffZones}${zone}" ] OR "fq" : [ "{!frange u=NOW}CutOffDate", "{!term f=PostCutOffZones}${zone}" ] } }, Thank you! Brian Yee
Fwd: Solr learning to rank features question
Hello, I have a somewhat complex solr filter query that I am hoping to turn into a feature for learning to rank, but I am not sure if it's possible. I would like to OR two fq together for one of my features. I have a cutoff date and I need to check one field if NOW is before the cutoff, and a different field if NOW is after the cutoff. Is this possible? Something to the effect of this: { "name" : "FeatureA", "store" : "commonFeatureStore", "class" : "org.apache.solr.ltr.feature.SolrFeature", "params" : { "fq" : [ "{!frange l=NOW}CutOffDate", "{!term f=PreCutOffZones}${zone}" ] OR "fq" : [ "{!frange u=NOW}CutOffDate", "{!term f=PostCutOffZones}${zone}" ] } }, Thank you! Brian Yee