Hi Eric,
My use case is quite simple. I was using the following configuration: <!-- synonyms are managed resources --> <fieldType name="managed_en" class="solr.TextField" positionIncrementGap="100"> <analyzer> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.ManagedSynonymFilterFactory" managed="english"/> </analyzer> </fieldType> <!-- synonyms act only in query time --> <fieldType name="watson_text" class="com.ibm.watson.hector.plugins.fieldtype.WatsonTextField" omitNorms="false" omitTermFreqAndPositions="false" indexed="true" termOffsets="true" stored="true" termPositions="true" termVectors="true"> <analyzer type="index"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.EnglishPossessiveFilterFactory"/> <filter class="solr.KeywordMarkerFilterFactory" protected="lang/protwords_en.txt"/> <filter class="solr.PorterStemFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.SynonymFilterFactory" expand="true" ignoreCase="true" synonyms="synonyms.txt"/> <filter class="solr.StopFilterFactory" words="lang/stopwords_en.txt" ignoreCase="true"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.EnglishPossessiveFilterFactory"/> <filter class="solr.KeywordMarkerFilterFactory" protected="lang/protwords_en.txt"/> <filter class="solr.PorterStemFilterFactory"/> </analyzer> </fieldType> But once my client is asking to add some synonyms, I changed to managed resources. And now, I just want to have sure if the following configuration is correct: <fieldType name="watson_text" class="com.ibm.watson.hector.plugins.fieldtype.WatsonTextField" omitNorms="false" omitTermFreqAndPositions="false" indexed="true" termOffsets="true" stored="true" termPositions="true" termVectors="true"> <analyzer type="index"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.EnglishPossessiveFilterFactory"/> <filter class="solr.KeywordMarkerFilterFactory" protected="lang/protwords_en.txt"/> <filter class="solr.PorterStemFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.ManagedSynonymFilterFactory" managed="english"/> <!—this is well configured? --> <filter class="solr.StopFilterFactory" words="lang/stopwords_en.txt" ignoreCase="true"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.EnglishPossessiveFilterFactory"/> <filter class="solr.KeywordMarkerFilterFactory" protected="lang/protwords_en.txt"/> <filter class="solr.PorterStemFilterFactory"/> </analyzer> </fieldType> What do you think? In terms of configuration, this is well defined? I tested it without errors. But... How can I know (or have sure) that my managed synonyms are being used in query time? How to test it? How to validate it? Regards, Daniel Moura -----Original Message----- From: Erick Erickson [mailto:erickerick...@gmail.com] Sent: 26 de dezembro de 2016 16:10 To: solr-user <solr-user@lucene.apache.org> Subject: Re: matching string to multivalued field Why are you trying to do this? I'm wondering if this is an XY problem. For instance, you could use a multivalued field of _text_ type with a positinIncrementGap of 100. Now you simply search (don't need function queries) for "Deli NCR"~90 and you wouldn't match across multiple entries. There are other tricks on this technique if, for instance, you didn't want to match "Deli NCR India" So if all you're doing it matching this is a much more robust solution. But without some statement of the problem you're trying to solve, i.e. the use-case, it's hard to suggest alternatives. Otherwise you're stuck with custom code I'm afraid. Best, Erick On Sun, Dec 25, 2016 at 11:36 AM, himanshu pal <hp.ii...@gmail.com<mailto:hp.ii...@gmail.com>> wrote: > Greetings all, > > I am trying to match a user input string with a multivalued field in solr. > For non multivalued fields I was using following function query > > strdist(def(state_exact,""),"Delhi NCR",edit) > > Using the same for multivalued fields throws following error "can not > use FieldCache on multivalued field" > > I googled it and found that some suggestions to make the field > multivalued=false so I combined all values to comma separated single > field but then the problem I faced was there is no ISSUBSTR builtin > function in solr. > > Is there any other way of solving this problem besides writing a > Custom ISSUBSTR function in solr. > > > Thanks, > Himanshu