lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Solr 6: how to get SortedSetDocValues from index by field name
Date Thu, 15 Jun 2017 21:56:57 GMT

https://people.apache.org/~hossman/#xyproblem
XY Problem

Your question appears to be an "XY Problem" ... that is: you are dealing
with "X", you are assuming "Y" will help you, and you are asking about "Y"
without giving more details about the "X" so that we can understand the
full issue.  Perhaps the best solution doesn't involve "Y" at all?
See Also: http://www.perlmonks.org/index.pl?node_id=542341




: How do I get SortedSetDocValues from index by field name?
: 
: I try it and it works for me but I didn't understand why to use
: leaves.get(0)? What does it mean? (I saw such using in
: TestUninvertedReader.java of SOLR-6.5.1):
: 
: *Map<String, UninvertingReader.Type> mapping = new HashMap<>();
: mapping.put(fieldName, UninvertingReader.Type.SORTED);
: 
: SolrIndexSearcher searcher = req.getSearcher();
: 
: DirectoryReader dReader = searcher.getIndexReader();
: LeafReader reader = null;
: 
: if (!dReader.leaves.isEmpty()) {
:   reader = dReader.leaves().get(0).reader;
:   return null;
: }
: 
: SortedSetDocValues sourceIndex = reader.getSortedSetDocValues(fieldName);*
: 
: Maybe do I need to use SlowAtomicReader, like it:
: 
: *
: UninvertingReader reader = new
: UninvertingReader(searcher.getSlowAtomicReader(), mapping)*;
: 
: What is right way to get SortedSetDocValues and why?
: 
: 
: 
: --
: View this message in context: http://lucene.472066.n3.nabble.com/Solr-6-how-to-get-SortedSetDocValues-from-index-by-field-name-tp4340388.html
: Sent from the Solr - User mailing list archive at Nabble.com.
: 

-Hoss
http://www.lucidworks.com/

Mime
View raw message