lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikhail Khludnev <m...@apache.org>
Subject Re: Query over nested documents with an AND Operator
Date Fri, 01 Feb 2019 13:51:15 GMT
Whats' your current query? It's probably a question of building boolean
query by combining Solr queries.
Note, this datamodel might be a little bit overwhelming, So, if number of
distinct attributename values is around a thousand, just handle it via
dynamic field without nesting docs:


  <field name="attributename_material ">brass</field>

                <field name="attributename_material quality>plastic</field>



On Fri, Feb 1, 2019 at 3:35 PM Gelszus Julia <j.gelszus@fis-gmbh.de> wrote:

> 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
> www.fis-gmbh.de
>
> Managing Directors:
> Ralf Bernhardt, Wolfgang Ebner, Frank Schöngarth
>
> Registration Office Schweinfurt HRB 2209
>
> <https://www.fis-gmbh.de/>  <https://de-de.facebook.com/FISgmbh>
> <https://www.xing.com/companies/fisinformationssystemeundconsultinggmbh>
> <http://www.kununu.com/de/all/de/it/fis-informationssysteme-consulting>
> <https://www.youtube.com/channel/UC49711WwZ_tSIp_QnAWdeQA>
>
>


-- 
Sincerely yours
Mikhail Khludnev

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