I think what Erick meant to say ;) was ....

defType=dismax does NOT do anything special with *:* other than treat it as 
plain text and does dismaxy things with it.   That’s exactly why there is q.alt 
for the dismax parser - so you can have your dismax and still match all docs by 
not having a q. 
 
   Erik

> On Jan 6, 2018, at 22:48, Erick Erickson <erickerick...@gmail.com> wrote:
> 
> As Chris explained, this is special:
> q=*:*
> in terms of scoring or anything of the like. It's just match-all-docs
> 
> It makes no sense to distribute *:* among "pf" fields. The whole point
> of pf is to influence scoring by providing a mechanism for boosting
> when words in some field(s) appear together for docs that _already_
> match the main clause. The fp fields may be totally
> unrelated to the qf fields. There's no reason to couple those together.
> 
> pf means "for docs that match the main query, add an additional boost
> if there are phrase matches in these fields". Whether the pf fields match
> a document has no influence on whether that doc is a hit, it only changes
> the score of docs that have been selected anyway because they matched
> the main clause.
> 
> Another way of saying the above is numFound won't change at all no
> matter whether there are matches on "pf" fields or not. Only the scores
> of those docs might change.
> 
> Since q=hello isn't match-all-docs, it does make sense to boost by "pf"
> field matches, even though it's just a single word. In that case it really
> means "boost docs matching the main clause if this word appears in
> the pf field".
> 
> On a different note, field names with hyphens aren't necessarily supported,
> so "name_shingle_zh-cn" may work, but there also may be edge cases
> where that causes problems. If there are, it's unlikely that fixing them
> will
> be a priority.
> 
> From the ref guide:
> 
> "The name of the field. Field names should consist of alphanumeric or
> underscore characters only and not start with a digit."
> 
> There has been talk at times of throwing warnings or errors if names violate
> this, but that'd break existing apps. It's one of those things that's we
> live
> with ;)
> 
> Best,
> Erick
> 
> On Sat, Jan 6, 2018 at 6:13 PM, Nawab Zada Asad Iqbal <khi...@gmail.com>
> wrote:
> 
>> Thanks everyone, that was a very informative thread.
>> 
>> One more curiosity: why are different set of fields being used based on the
>> query string:-
>> 
>> 
>> http://localhost:8983/solr/filesearch/select?fq=id:1193&;
>> q=*:*&debugQuery=true
>> 
>> 
>>   - parsedquery: "+DisjunctionMaxQuery((user_email:*:* | user_name:*:* |
>>   tags:*:* | (name_shingle_zh-cn:, , name_shingle_zh-cn:, ,) |
>> id:*:*)~0.01)
>>   DisjunctionMaxQuery(((name_shingle_zh-cn:", , , ,"~100)^100.0 |
>>   tags:*:*)~0.01)",
>> 
>> 
>> 
>> I find it perplexing as the default values for qf and pf are very different
>> from above so I am not sure where these fields are coming from (although
>> they are all valid fields)
>> e.g. following query uses the my expected set of pf and qf.
>> 
>> http://localhost:8983/solr/filesearch/select?fq=id:1193&;
>> q=hello&debugQuery=true
>> 
>> 
>> 
>>   - parsedquery: "+DisjunctionMaxQuery(((name_token:hello)^60.0 |
>>   user_email:hello | (name_combined:hello)^10.0 | (name_zh-cn:hello)^10.0
>> |
>>   name_shingle:hello | comments:hello | user_name:hello |
>> description:hello |
>>   file_content_zh-cn:hello | file_content_de:hello | tags:hello |
>>   file_content_it:hell | file_content_fr:hello | file_content_es:hell |
>>   file_content_en:hello | id:hello)~0.01)
>> DisjunctionMaxQuery((description:hello
>>   | (name_shingle:hello)^100.0 | comments:hello | tags:hello)~0.01)",
>> 
>> 
>> On Sat, Jan 6, 2018 at 12:05 PM, Chris Hostetter <hossman_luc...@fucit.org
>>> 
>> wrote:
>> 
>>> 
>>> : Yes, i am using dismax. But dismax allows *:* for q.alt ,which also
>> seems
>>> : like inconsistency.
>>> 
>>> dismax is a *parser* that affects how a single query string is parsed.
>>> 
>>> when you use defType=dismax, that only changes how the "q" param is
>>> parsed -- not any other query string params, like "fq" or "facet.query"
>>> (or "q.alt")
>>> 
>>> when you have a request like "defType=dismax&q=&q.alt=*:*" what you are
>>> saying, and what solr is doing, is...
>>> 
>>> * YOU: hey solr, use dismax as the default parser for the q param
>>> * SEARCHHANDLER: ok, if the "q" param does not use local params to
>>> override the parser, i will use dismax
>>> * SEARCHHANDLER: hey dismax qparser, go parse the string ""
>>> * DISMAXQP: that string is empty, so instead we should use q.alt
>>> * SEARCHHANDLER: ok, i will parse the q.alt param and use that query in
>>> place of the empty q param
>>> * SEARCHHANDLER: hey lucene qparser, the string "*:*" does not use local
>>> params to override the parser, please parse it
>>> * LUCENEQP: the string "*:*" is a MatchAllDocsQuery
>>> * SEARCHHANDLER: cool, i'll use that as my main query
>>> 
>>> 
>>> 
>>> -Hoss
>>> http://www.lucidworks.com/
>>> 
>> 

Reply via email to