Multivalue Field lookup
Hello! I am new to SOLR. This is my field type definition: > stored="true" multiValued="true" omitTermFreqAndPositions="true" > omitNorms="true" /> One use-case we have is to lookup multiple myid with an OR like > fq=myid:(1 2 3 4..) I wish to know which entry in the fq matched this document. I am doing a group query now as a hack. like: > "group.query":["myid:1", "myid:2",...] Is there a better way to do this ? Regards, Kumaresh
Re: Multivalue Field lookup
Hi Mikhail, Thanks for the response. I see the results have the details I am looking for. But it is not well structured. I sense that the debug=results is for understanding the scoring behind the results which can be more than what I am looking for. Is there any other way ? The multivalued field may have some 50 items in it at most. And the query will be limited to 100 values. On Sun, Apr 14, 2019 at 1:04 AM Mikhail Khludnev wrote: > Hello, Kumaresh! > > If you turn it to q you may try debug=results&debug.explain.structured=true > with some performance impact. > > On Sun, Apr 14, 2019 at 2:41 AM Kumaresh AK > wrote: > > > Hello! > > I am new to SOLR. This is my field type definition: > > > > > > > stored="true" multiValued="true" omitTermFreqAndPositions="true" > > > omitNorms="true" /> > > > > > > One use-case we have is to lookup multiple myid with an OR like > > > > > fq=myid:(1 2 3 4..) > > > > I wish to know which entry in the fq matched this document. I am doing a > > group query now as a hack. like: > > > > > "group.query":["myid:1", "myid:2",...] > > > > Is there a better way to do this ? > > > > Regards, > > Kumaresh > > > > > -- > Sincerely yours > Mikhail Khludnev >
Re: Multivalue Field lookup
How would I go about change by field type to facilitate highlighting ? I tried hl on my current schema and the highlight section is empty. I guess I need to change to multivalue text. Currently it is String Field as these are identifiers and no analysis needed on those On Sun, Apr 14, 2019 at 5:29 AM Mikhail Khludnev wrote: > Btw, can it be done by highlighting? > > On Sun, Apr 14, 2019 at 3:22 PM Kumaresh AK > wrote: > > > Hi Mikhail, > > Thanks for the response. I see the results have the details I am looking > > for. But it is not well structured. I sense that the debug=results is for > > understanding the scoring behind the results which can be more than what > I > > am looking for. Is there any other way ? The multivalued field may have > > some 50 items in it at most. And the query will be limited to 100 values. > > > > On Sun, Apr 14, 2019 at 1:04 AM Mikhail Khludnev > wrote: > > > > > Hello, Kumaresh! > > > > > > If you turn it to q you may try > > debug=results&debug.explain.structured=true > > > with some performance impact. > > > > > > On Sun, Apr 14, 2019 at 2:41 AM Kumaresh AK > > > wrote: > > > > > > > Hello! > > > > I am new to SOLR. This is my field type definition: > > > > > > > > > > > > > stored="true" multiValued="true" omitTermFreqAndPositions="true" > > > > > omitNorms="true" /> > > > > > > > > > > > > One use-case we have is to lookup multiple myid with an OR like > > > > > > > > > fq=myid:(1 2 3 4..) > > > > > > > > I wish to know which entry in the fq matched this document. I am > doing > > a > > > > group query now as a hack. like: > > > > > > > > > "group.query":["myid:1", "myid:2",...] > > > > > > > > Is there a better way to do this ? > > > > > > > > Regards, > > > > Kumaresh > > > > > > > > > > > > > -- > > > Sincerely yours > > > Mikhail Khludnev > > > > > > > > -- > Sincerely yours > Mikhail Khludnev >
Re: Multivalue Field lookup
Thanks Edwin for the information. I will try highlighting.. On Sun, Apr 14, 2019 at 7:53 PM Zheng Lin Edwin Yeo wrote: > You need to set the field which you want to highlight in the hl.fl > parameter in your solrconfig.xml. > Highlighting can work in String field. > > Regards, > Edwin > > On Mon, 15 Apr 2019 at 05:53, Kumaresh AK wrote: > > > How would I go about change by field type to facilitate highlighting ? I > > tried hl on my current schema and the highlight section is empty. I > guess I > > need to change to multivalue text. Currently it is String Field as these > > are identifiers and no analysis needed on those > > > > On Sun, Apr 14, 2019 at 5:29 AM Mikhail Khludnev > wrote: > > > > > Btw, can it be done by highlighting? > > > > > > On Sun, Apr 14, 2019 at 3:22 PM Kumaresh AK > > > wrote: > > > > > > > Hi Mikhail, > > > > Thanks for the response. I see the results have the details I am > > looking > > > > for. But it is not well structured. I sense that the debug=results is > > for > > > > understanding the scoring behind the results which can be more than > > what > > > I > > > > am looking for. Is there any other way ? The multivalued field may > have > > > > some 50 items in it at most. And the query will be limited to 100 > > values. > > > > > > > > On Sun, Apr 14, 2019 at 1:04 AM Mikhail Khludnev > > > wrote: > > > > > > > > > Hello, Kumaresh! > > > > > > > > > > If you turn it to q you may try > > > > debug=results&debug.explain.structured=true > > > > > with some performance impact. > > > > > > > > > > On Sun, Apr 14, 2019 at 2:41 AM Kumaresh AK < > kumaresh...@nielsen.com > > > > > > > > wrote: > > > > > > > > > > > Hello! > > > > > > I am new to SOLR. This is my field type definition: > > > > > > > > > > > > > indexed="true" > > > > > > > stored="true" multiValued="true" > omitTermFreqAndPositions="true" > > > > > > > omitNorms="true" /> > > > > > > > > > > > > > > > > > > One use-case we have is to lookup multiple myid with an OR like > > > > > > > > > > > > > fq=myid:(1 2 3 4..) > > > > > > > > > > > > I wish to know which entry in the fq matched this document. I am > > > doing > > > > a > > > > > > group query now as a hack. like: > > > > > > > > > > > > > "group.query":["myid:1", "myid:2",...] > > > > > > > > > > > > Is there a better way to do this ? > > > > > > > > > > > > Regards, > > > > > > Kumaresh > > > > > > > > > > > > > > > > > > > > > -- > > > > > Sincerely yours > > > > > Mikhail Khludnev > > > > > > > > > > > > > > > > > > -- > > > Sincerely yours > > > Mikhail Khludnev > > > > > >
Metrics reporting
Hello! I see two ways to get metrics from solr: jmx and metrics API. Is there a preference to use one over the other ? Regards, Kumaresh
Re: Metrics reporting
Thanks Erick. > On Apr 29, 2019, at 5:23 AM, Erick Erickson wrote: > > The metrics API is probably preferred if for no other reason than JMX needs > some work with your admins to insure the security is set up properly. > >> On Apr 28, 2019, at 4:56 PM, Kumaresh AK wrote: >> >> Hello! >> I see two ways to get metrics from solr: jmx and metrics API. Is there a >> preference to use one over the other ? >> >> Regards, >> Kumaresh >
Query terms and the match state
Hello Solr Community! *Problem*: I wish to know if the result document matched all the terms in the query. The ranking used in solr works most of the time. For some cases where one of the term is rare and occurs in couple of fields; such documents trump a document which matches all the terms. Ideally i wish to have such a document (that matches all terms) to trump a document that matches only 9/10 terms but matches one of the rare terms twice. eg: *query1* field1:(a b c d) field2:(a b c d) Results of the above query looks good. *query2* filed1:(a b c 5) field2:(a b c 5) result: doc1: {field1: b c 5 field2: b c 5} doc21: {field1: a b c 5 field: null} Results are almost good except that doc21 is trailing doc1. There are a few documents similar to doc1 and pushes doc21 to next page (I use default page size = 10) I understand that this is how tf-idf works. I tried to boost certain fields to solve this problem. But that breaks normal cases (query1). So, I set out to just solve the case where I wish to boost (or) augment a field with that information (as ratio of matched-terms/total-terms) *Ask:* Is it possible to get back the terms of the query and the matched state ? I tried - debug=query option (with the default select handler) - with terms in the debug response I could write a function query to know its match state Is this approach safe/performant for production use ? Is there a better approach to solve this problem ? Regards, Kumaresh