lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gelszus Julia <>
Subject Query over nested documents with an AND Operator
Date Fri, 01 Feb 2019 06:30:44 GMT
recently I started to work with Apache SOLR 7.6.0 in the course of a project. I encountered
the following problem during the queries, where I want to know if the SOLR offers this in
We want to index a nested XML document, which can have the following structure:
- there are 1-n Parent Documents which each contain the article data (short text, long text
-in addition, each Parent Document can have 0-n Child Documents containing the attributes
of the article
-example of an XML file:
  <field name="id">1</field>
  <field name="article">4711</field>
  <field name="shorttext">here is a short text dealing with plastic and brass</field>
  <field name="longtext">here is a detailed description</field>
  <field name="contenttype">parentDocument</field>
  <field name="id">2</field>
  <field name="article">4811</field>
  <field name="shorttext">here is a shorttext</field>
  <field name="longtext">here you will find a detailed description</field>
  <field name="contenttype">parentDocument</field>
  <field name="attributes">
  <field name="id">2_1</field>
  <field name="attributename">material </field>
  <field name="attributevalue">brass</field>
  <field name="id">2_2</field>
  <field name="attributename">material quality</field>
  <field name="attributevalue">plastic</field>
</field name="attributes">
I need an AND operator between my queries because I want to get as accurate hits as possible.
I managed to search all Parent and Child Documents with one search term and get the right
But if I want to search for example for plastic and brass (that means 2 or more search terms).
I want to get both the Parent Document for the respective child document as result (article
4811), as well as article 4711 because in this article the two words appear in the description.
But the result of my query is always only article 4711. I know that I could also write the
attribute in one field. However, I want to have a facet about the attribute name.

I hope you can help me with this problem.

Thank you very much,

Mit freundlichen Grüßen / Kind regards

Julia Gelszus

Bachelor of Science
Consultant SAP Development Workbench

FIS Informationssysteme und Consulting GmbH
Röthleiner Weg 1
97506 Grafenrheinfeld

P +49 (9723) 9188-667
F +49 (9723) 9188-200
Managing Directors:
Ralf Bernhardt, Wolfgang Ebner, Frank Schöngarth

Registration Office Schweinfurt HRB 2209

[cid:image001.jpg@01D4B9FB.5FCEDF70]<>  [cid:image002.jpg@01D4B9FB.5FCEDF70]
<>   [cid:image003.jpg@01D4B9FB.5FCEDF70] <>
  [cid:image004.jpg@01D4B9FB.5FCEDF70] <>
  [cid:image005.jpg@01D4B9FB.5FCEDF70] <>

  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message