Search for a multi-valued self-connecting field

I have the following (simplified) solr scheme:

<schema name="documents" version="1.1"> <uniqueKey>id</uniqueKey> ... <fields> <field name="id" type="string" indexed="true" stored="true" required="true"/> <field name="documentReferences" type="string" indexed="true" stored="false" multiValued="true" required="false"/> </fields> </schema> 

The values ​​that will be in this documentReferences field are all ids other documents that are indexed in this core solr.

The search I want to perform (in English):

 Documents who id is not in any other document documentReferences field 

Is it possible? I have no problem indexing another field if this helps answer this question.

+4
source share
1 answer

One of the solutions I was thinking about was

  • Index the identifier with the documents themselves to make sure that if the document does not refer to any other document, the account will be one of them.
  • Search all Facet documents on document links, and then filter the columns with counter 1, which will be a list of identifiers not specified by other identifiers
  • It would be interesting to use the facet maxcount parameter, which would limit the search results out of the box.
0
source

Source: https://habr.com/ru/post/1481285/


All Articles