How to retrieve relevance "explain" info in code?
Hi, I was trying to get the detailed "explain" info in (java) code using the APIs, see codes below, - ResponseBuilder rb (from some inherited process function) SolrIndexSearcher searcher = rb.req.getSearcher(); Query query = rb.getQuery(); Explanation epl = searcher.explain(query, docId) - here, the docId is a valid doc id, the query is a valid one as well (verified in log); however, I always get back score 0.0 for any matching INFO: 0.0 = (NON-MATCH) Failure to meet condition(s) of required/prohibited clause(s) but if I issue the same query thru url with debugQuery=on, the explain section shows the breakdown of the score correctly. anything I'm missing here? thanks, - danny Z -- View this message in context: http://old.nabble.com/How-to-retrieve-relevance-%22explain%22-info-in-code--tp27602530p27602530.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: How to retrieve relevance "debug/explain" info in code?
any hints? -- View this message in context: http://old.nabble.com/How-to-retrieve-relevance-%22debug-explain%22-info-in-code--tp27602530p27612814.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: How to retrieve relevance "debug/explain" info in code?
Hi erick, thanks for the reply. my query url includes "debugQuery=on" and the result page is correctly showing all the debug / explain info. the problem I'm facing is that I cannot get the same debug/explain info in code. I've been trying IndexSearcher.explain(Weight, int ) API, as well as Searcher.explain( Query, int ) API, the methods (in code) always throw me 0.0 score, whereas on url return page everything's fine. appreciate the help =) Erick Erickson wrote: > > Any details? This is pretty ambiguous > > tacking debugQuery=true to a URL brings back some stuff > > in Lucene, IndexSearcher.explain()? > > Erick > > On Tue, Feb 16, 2010 at 1:21 PM, uwdanny wrote: > >> >> any hints? >> -- >> View this message in context: >> http://old.nabble.com/How-to-retrieve-relevance-%22debug-explain%22-info-in-code--tp27602530p27612814.html >> Sent from the Solr - User mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://old.nabble.com/How-to-retrieve-relevance-%22debug-explain%22-info-in-code--tp27602530p27613601.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: How to retrieve relevance "debug/explain" info in code?
update - found the answer API getExplainList in org.apache.solr.util.SolrPluginUtils works. uwdanny wrote: > > Hi, > > I was trying to get the detailed "explain" info in (java) code using the > APIs, see codes below, > > - > ResponseBuilder rb (from some inherited process function) > SolrIndexSearcher searcher = rb.req.getSearcher(); > Query query = rb.getQuery(); > Explanation epl = searcher.explain(query, docId) > - > > here, the docId is a valid doc id, the query is a valid one as well > (verified in log); however, I always get back score 0.0 for any matching > > INFO: 0.0 = (NON-MATCH) Failure to meet condition(s) of > required/prohibited clause(s) > > > but if I issue the same query thru url with debugQuery=on, the explain > section shows the breakdown of the score correctly. > > anything I'm missing here? > > thanks, > > - danny Z > -- View this message in context: http://old.nabble.com/How-to-retrieve-relevance-%22debug-explain%22-info-in-code--tp27602530p27617278.html Sent from the Solr - User mailing list archive at Nabble.com.
highlight multi-valued field returns weird cut-off highlighted terms
Basically, the problem is that query keyword "pizza" occurs in 4 out of 10 values in multi-valued field "TEST_KEYWORDS"; in the first two matching/highlighting, only "pizz" is highlighted with an extra space beforehand ( pizz), and "a" is left behind; and in the other two highlighting, "pizza" is correctly highlighted. Any hints on this weirdness? thanks, - dz here's the data little caesars little caesars pizza little ceasers little ceasars pizza little ceasers pizza little ceasars little ceasar Little Caesar little cesar little ceasar pizza 2664694 and the following is the highlight for this field − − little caesars pizza − little ceasars pizza − little ceasers pizza − little ceasar pizza -- View this message in context: http://old.nabble.com/highlight-multi-valued-field-returns-weird-cut-off-highlighted-terms-tp27785795p27785795.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: highlight multi-valued field returns weird cut-off highlighted terms
in this "error" case, the origin query "q=pizza" thanks - the best is yet to come~ -- View this message in context: http://old.nabble.com/highlight-multi-valued-field-returns-weird-cut-off-highlighted-terms-tp27785795p27787663.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: highlight multi-valued field returns weird cut-off highlighted terms
Thanks a lot Koji; I'll do some deep diving on my tokenizer modification part. appreciate the pointers! Koji Sekiguchi-2 wrote: > > uwdanny wrote: >> in this "error" case, the origin query "q=pizza" >> >> > indexed="true" stored="true" termVectors="false" omitNorms="true"/> >> >> > positionIncrementGap="100"> >> >> > class="org.apache.lucene.analysis.PhraseTokenFactory" >> phraseSynonyms="phrase_synonyms.txt" includeSubphrases="true"/> >> > class="org.apache.lucene.analysis.ApostropheTokenFactory"/> >> > synonyms="headings_synonyms.txt" ignoreCase="true" expand="true" >> tokenizerFactory="org.apache.lucene.analysis.PhraseTokenFactory"/> >> > synonyms="listing_name_synonyms.txt" ignoreCase="true" expand="true" >> tokenizerFactory="org.apache.lucene.analysis.PhraseTokenFactory"/> >> > synonyms="space_variants.txt" ignoreCase="true" expand="true" >> tokenizerFactory="org.apache.lucene.analysis.PhraseTokenFactory"/> >> > generateWordParts="0" generateNumberParts="1" catenateWords="0" >> catenateNumbers="1" catenateAll="0" splitOnCaseChange="1" >> preserveOriginal="1"/> >> >> > class="org.apache.lucene.analysis.KStemFilterFactory" cacheSize="2"/> >> >> >> > class="org.apache.lucene.analysis.PhraseTokenFactory"/> >> > generateWordParts="0" generateNumberParts="1" catenateWords="0" >> catenateNumbers="1" catenateAll="0" splitOnCaseChange="1" >> preserveOriginal="1"/> >> >> > class="org.apache.lucene.analysis.KStemFilterFactory" cacheSize="2"/> >> >> >> >> thanks >> >> - >> the best is yet to come~ >> > What is PhraseTokenFactory in the above? > If the Tokenizer's end() method doesn't work correctly, > you may get the trouble you were facing. > > Also consult: > https://issues.apache.org/jira/browse/LUCENE-2207 > > Koji > > -- > http://www.rondhuit.com/en/ > > > - the best is yet to come~ -- View this message in context: http://old.nabble.com/highlight-multi-valued-field-returns-weird-cut-off-highlighted-terms-tp27785795p27797310.html Sent from the Solr - User mailing list archive at Nabble.com.