lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gelszus Julia <j.gels...@fis-gmbh.de>
Subject Query over nested documents with an AND Operator
Date Fri, 01 Feb 2019 06:30:44 GMT
Hello,
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
general:
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
etc.)
-in addition, each Parent Document can have 0-n Child Documents containing the attributes
of the article
-example of an XML file:
<doc>
  <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>
  </doc>
<doc>
  <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">
<doc>
  <field name="id">2_1</field>
  <field name="attributename">material </field>
  <field name="attributevalue">brass</field>
  </doc>
  <doc>
  <field name="id">2_2</field>
  <field name="attributename">material quality</field>
  <field name="attributevalue">plastic</field>
  </doc>
</field name="attributes">
</doc>
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
result.
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
E j.gelszus@fis-gmbh.de
<mailto:j.gelszus@fis-gmbh.de>www.fis-gmbh.de
<http://www.fis-gmbh.de>
Managing Directors:
Ralf Bernhardt, Wolfgang Ebner, Frank Schöngarth

Registration Office Schweinfurt HRB 2209

[cid:image001.jpg@01D4B9FB.5FCEDF70]<https://www.fis-gmbh.de/>  [cid:image002.jpg@01D4B9FB.5FCEDF70]
<https://de-de.facebook.com/FISgmbh>   [cid:image003.jpg@01D4B9FB.5FCEDF70] <https://www.xing.com/companies/fisinformationssystemeundconsultinggmbh>
  [cid:image004.jpg@01D4B9FB.5FCEDF70] <http://www.kununu.com/de/all/de/it/fis-informationssysteme-consulting>
  [cid:image005.jpg@01D4B9FB.5FCEDF70] <https://www.youtube.com/channel/UC49711WwZ_tSIp_QnAWdeQA>


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