Re: facet on two multi-valued fields
Hi, BlockJoin with Parent/Child is your solution. See http://yonik.com/solr-nested-objects/ and https://cwiki.apache.org/confluence/display/solr/BlockJoin+Faceting -- Jan Høydahl, search solution architect Cominvent AS - www.cominvent.com > 3. mar. 2016 kl. 10.35 skrev Andreas Hubold: > > Hi, > > sorry, the subject may have been misleading. I want to get facet results for > only one field (tagIds) but restrict the returned values to those with a > matching tagDescription. Both multi-valued fields have the same order. > > Example docs > > id:"1" > tagIds:["10","12","13"] > tagDescriptions:["News", "Sport News", "Economy"] > text:"... foo ..." > > id:"2" > tagIds:["14", "10"] > tagDescriptions:["IT", "News"] > text:"... foo ..." > > Query > q=text:foo > =tagDescriptions:news > =tagIds > > IIRC, this would give me a facet result with values 10, 12, 13, 14 but I want > to restrict the result to 10, 12 (the ones with "News" in their > tagDescription) > > I thought about using query-time join but am unsure about performance > implications (if there are many tags) and concrete usage. > > Or is it possible to somehow put both tagIds and tagDescriptions into a > single multi-valued field? > > Thank you, > Andreas > > > Jan Høydahl schrieb am 02.03.2016 um 22:52: >> It makes no sense to facet on a “text_general” ananlyzed field. Can you give >> a concrete example with a few dummy docs and show some queries (do you query >> the tagDescription field?) and wanted facet output? >> >> There may be several ways to solve the task, depending on the exact use >> case. One solution could be to use child documents. >> >> -- >> Jan Høydahl, search solution architect >> Cominvent AS - www.cominvent.com >> >>> 2. mar. 2016 kl. 17.30 skrev Andreas Hubold : >>> >>> Hi, >>> >>> my schema looks like this >>> >>> >>> >> multiValued="true"/> >>> >> stored="false" multiValued="true"/> >>> >>> >>> I'd like to get the tagIds of documents with a certain tagDescription (and >>> text). However tagIds contains multiple ids in the same order as >>> tagDescription and simple faceting would return all. Is there a way to just >>> get the IDs of the tags with a matching description? >>> >>> Or would you recommend some other schema? >>> >>> Thanks, >>> Andreas >>> >>> >> >
Re: facet on two multi-valued fields
Hi, sorry, the subject may have been misleading. I want to get facet results for only one field (tagIds) but restrict the returned values to those with a matching tagDescription. Both multi-valued fields have the same order. Example docs id:"1" tagIds:["10","12","13"] tagDescriptions:["News", "Sport News", "Economy"] text:"... foo ..." id:"2" tagIds:["14", "10"] tagDescriptions:["IT", "News"] text:"... foo ..." Query q=text:foo =tagDescriptions:news =tagIds IIRC, this would give me a facet result with values 10, 12, 13, 14 but I want to restrict the result to 10, 12 (the ones with "News" in their tagDescription) I thought about using query-time join but am unsure about performance implications (if there are many tags) and concrete usage. Or is it possible to somehow put both tagIds and tagDescriptions into a single multi-valued field? Thank you, Andreas Jan Høydahl schrieb am 02.03.2016 um 22:52: It makes no sense to facet on a “text_general” ananlyzed field. Can you give a concrete example with a few dummy docs and show some queries (do you query the tagDescription field?) and wanted facet output? There may be several ways to solve the task, depending on the exact use case. One solution could be to use child documents. -- Jan Høydahl, search solution architect Cominvent AS - www.cominvent.com 2. mar. 2016 kl. 17.30 skrev Andreas Hubold: Hi, my schema looks like this I'd like to get the tagIds of documents with a certain tagDescription (and text). However tagIds contains multiple ids in the same order as tagDescription and simple faceting would return all. Is there a way to just get the IDs of the tags with a matching description? Or would you recommend some other schema? Thanks, Andreas
Re: facet on two multi-valued fields
It makes no sense to facet on a “text_general” ananlyzed field. Can you give a concrete example with a few dummy docs and show some queries (do you query the tagDescription field?) and wanted facet output? There may be several ways to solve the task, depending on the exact use case. One solution could be to use child documents. -- Jan Høydahl, search solution architect Cominvent AS - www.cominvent.com > 2. mar. 2016 kl. 17.30 skrev Andreas Hubold: > > Hi, > > my schema looks like this > > > multiValued="true"/> > stored="false" multiValued="true"/> > > > I'd like to get the tagIds of documents with a certain tagDescription (and > text). However tagIds contains multiple ids in the same order as > tagDescription and simple faceting would return all. Is there a way to just > get the IDs of the tags with a matching description? > > Or would you recommend some other schema? > > Thanks, > Andreas > >
facet on two multi-valued fields
Hi, my schema looks like this multiValued="true"/> stored="false" multiValued="true"/> I'd like to get the tagIds of documents with a certain tagDescription (and text). However tagIds contains multiple ids in the same order as tagDescription and simple faceting would return all. Is there a way to just get the IDs of the tags with a matching description? Or would you recommend some other schema? Thanks, Andreas