[ 
https://issues.apache.org/jira/browse/LUCENE-7851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16023867#comment-16023867
 ] 

Robert Muir commented on LUCENE-7851:
-------------------------------------

If you are searching all documents for a string value (does not matter if it 
contains a key=value thingy that you put in it), then the best way does not 
involve docvalues at all, it is to index those key-value pairs as terms in the 
inverted index and search on them with TermQuery.

But maybe you have different requirements or something I am missing.

The best forum for these kinds of questions is the java-u...@lucene.apache.org 
mailing list. You can find instructions here: 
http://lucene.apache.org/core/discussion.html#java-user-list-java-userluceneapacheorg

> Lucene54DocValuesProducer#getSortedSetTable lookupTerm does not honor 
> setDocument
> ---------------------------------------------------------------------------------
>
>                 Key: LUCENE-7851
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7851
>             Project: Lucene - Core
>          Issue Type: Bug
>    Affects Versions: 6.0.1
>            Reporter: Vesa Pirila
>
> I'm having a problem with the lookupTerm method of the anonymous 
> RandomAccessOrds class returned by 
> Lucene54DocValuesProducer#getSortedSetTable(). It does not seem to honor 
> setDocument. It returns the same ord every time regardless of my calling 
> setDocument with different arguments.
> To reproduce:
> I have two documents with a multi-valued string field "strfield". Both have a 
> single value "a". I have a custom class that extends FieldCacheSource. This 
> is obviously just a dummy, but it's the simplest way I know to reproduce the 
> problem.
> {code:java}
> public class MyValueSource extends FieldCacheSource {
>   public MyValueSource(String field) {
>     super(field);
>   }
>   @Override
>   public FunctionValues getValues(Map map, LeafReaderContext readerContext) 
> throws IOException {
>     SortedSetDocValues dvs = DocValues.getSortedSet(readerContext.reader(), 
> FieldNames.PARENTS_DATES);
>     dvs.setDocument(0);
>     long zeroOrd = dvs.lookupTerm(new BytesRef("a"));
>     dvs.setDocument(1);
>     long oneOrd = dvs.lookupTerm(new BytesRef("a"));
>     assert(zeroOrd != oneOrd); // FAILS. The same ord is always returned.
>     return new LongDocValues(this) {
>       @Override
>       public long longVal(int doc) {
>         return 0;
>       }
>     };
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to