Hi Mikhail, Thanks for your response. Here is an example of what I'm trying to do. If I had the following documents:
<doc> <field name="id">10</field> <field name="type_s">parent</field> <field name="name_s">User1</field> <doc> <field name="id">11</field> <field name="search_s">item1, item6</field> </doc> <doc> <field name="id">12</field> <field name="search_s">item2, item7</field> </doc> <doc> <field name="id">13</field> <field name="search_s">item3, item8</field> </doc> </doc> <doc> <field name="id">20</field> <field name="type_s">parent</field> <field name="name_s">user2</field> <doc> <field name="id">21</field> <field name="search_s">item1, item6</field> </doc> <doc> <field name="id">22</field> <field name="search_s">item2, item7</field> </doc> <doc> <field name="id">23</field> <field name="search_s">item8</field> </doc> </doc> I would like to do a search for users with item1 and item2 and not item3, and that query should only return user2. I have tried this with a block join query with solr 4.6.1 and it does not work the way I need it to. If you have any ideas let me know. Thanks, Luke On Sat, Mar 29, 2014 at 1:46 PM, Mikhail Khludnev [via Lucene] < ml-node+s472066n4127896...@n3.nabble.com> wrote: > Hello Luke, > > If I get you right, you need to combine parent (block join) queries e.g > users who have a record with item1 AND users who have a record with item2. > > Does it make sense? If it does, do you need to figure out a syntax? > 28.03.2014 14:19 пользователь "mertens" <[hidden > email]<http://user/SendEmail.jtp?type=node&node=4127896&i=0>> > написал: > > > Hello Solr Users, > > > > In my system I have multiple records belonging to users, and I need to > > perform a query to find users who have records that meet the criteria of > > that query. For example, if my record has the field "search" and I query > > for > > search:((item1 AND item2) NOT item3), I want to find all users that have > > one > > or more records with item1 and one or more records with item2 but no > > records > > containing item3. > > > > I have investigated the block join parent query which comes close to the > > functionality that I need, but it appears to apply the entire query to > each > > individual child document, rather than across all child documents. > > > > At the moment the only solutions I can think of are to combine all the > user > > records into one giant document for each user or do some sort of OR > query > > to > > get all documents with partial matches for each user and then manually > > verify that my result document set satisfies my criteria. Neither of > these > > solutions sounds very attractive to me. Does anyone else have any advice > or > > recommendations for this scenario? > > > > Thanks, > > Luke > > > > > > > > -- > > View this message in context: > > > http://lucene.472066.n3.nabble.com/Block-Join-Parent-Query-across-children-docs-tp4127637.html > > Sent from the Solr - User mailing list archive at Nabble.com. > > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://lucene.472066.n3.nabble.com/Block-Join-Parent-Query-across-children-docs-tp4127637p4127896.html > To unsubscribe from Block Join Parent Query across children docs, click > here<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4127637&code=bG1lcnRlbnNAZ21haWwuY29tfDQxMjc2Mzd8LTU0NDAxMzQzMw==> > . > NAML<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://lucene.472066.n3.nabble.com/Block-Join-Parent-Query-across-children-docs-tp4127637p4128554.html Sent from the Solr - User mailing list archive at Nabble.com.