lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Taher Galal <taher.gala...@gmail.com>
Subject Grouping on MultiValue Field
Date Wed, 24 Feb 2016 12:32:04 GMT
Hi,

I have a tree structure of documents, with a document having multiple
parents. This is mapped in the Lucene index using a multivaluefield when
indexing as so:

Document doc = new Document();
doc.add(new Field("uuid","value",MYFIELDTYPE.NOTANALYZED);
doc.add(new Field("parent","parent",MYFIELDTYPE.NOTANALYZED);
doc.add(new Field("parent","parent",MYFIELDTYPE.NOTANALYZED);......
indexwriter.addDocument(doc)

I then need to group the results I get having the most common parent of the
tree as my final result. I am facing a problem as the parent field contains
only the direct parent, this direct parent is stored also in the index in
the same way but when collecting the documents I don't know how to access
it within the collect(ind docID) I can access the fields and group through
inserting into a map but how do a group for example if two elements within
a group have the same parent. Also if a change to the index would be welcome

any input will be grateful


Best Regards,


Taher Galal

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