That implies that you’re using two different queryParsers, one for the “q”
portion and one for the “fq” portion. My guess is that you have solrconfig
/select or /query configured to use (e)dismax but your fq clause is being
parsed by, the LuceneQueryParser.
You can specify the parser via local params, i.e. fq={!edismax blah blah}query
terms.
Add &debug=query to your input and you’ll see exactly which parsers are used
for what parts of the query.
Best,
Erick
> On Jun 25, 2019, at 11:30 AM, Wei <[email protected]> wrote:
>
> Thanks Erick for the clarification. How does the ps work for fq? I
> configured ps=4 for q, it doesn't apply to fq though. For phrase queries in
> fq seems ps=0 is used. Is there a way to config it for fq also?
>
> Best,
> Wei
>
> On Tue, Jun 25, 2019 at 9:51 AM Erick Erickson <[email protected]>
> wrote:
>
>> q and fq do _exactly_ the same thing in terms of query parsing, subject to
>> all the same conditions.
>>
>> There are two things that apply to fq clauses that have nothing to do with
>> the query _parsing_.
>> 1> there is no scoring, so it’s cheaper from that perspective
>> 2> the results are cached in a bitmap and can be re-used later
>>
>> Best,
>> Erick
>>
>>> On Jun 24, 2019, at 7:06 PM, Wei <[email protected]> wrote:
>>>
>>> Thanks Shawn! I didn't notice the asterisks are created during
>> copy/paste,
>>> one lesson learned :)
>>> Does that mean when fq is applied to text fields, it is doing text match
>>> in the field just like q in a query field? While for string fields, it
>> is
>>> exact match.
>>> If it is a phrase query, what are the values for relate parameters such
>> as
>>> ps?
>>>
>>> Thanks,
>>> Wei
>>>
>>> On Mon, Jun 24, 2019 at 4:51 PM Shawn Heisey <[email protected]>
>> wrote:
>>>
>>>> On 6/24/2019 5:37 PM, Wei wrote:
>>>>> <field name=“description” type=“*simpletext*” indexed="true"
>>>> stored="true"/>
>>>>
>>>> I'm assuming that the asterisks here are for emphasis, that they are not
>>>> actually present. This can be very confusing. It is far better to
>>>> relay the precise information and not try to emphasize anything.
>>>>
>>>>> For query q=*:*&fq=description:”ice cream”, the filter query returns
>>>>> matches for “ice cream bar” and “vanilla ice cream” , but does not
>> match
>>>>> for “ice cold cream”.
>>>>>
>>>>> The results seem neither exact match nor phrase match. What's the
>>>> expected
>>>>> behavior for fq on text fields? I have tried to look into the solr
>> docs
>>>>> but there is no clear explanation.
>>>>
>>>> If the quotes are present in what you actually sent to Solr, then that
>>>> IS a phrase query. And that is why it did not match your third example.
>>>>
>>>> Try one of these instead:
>>>>
>>>> q=*:*&fq=description:(ice cream)
>>>>
>>>> q=*:*&fq=description:ice description:cream)
>>>>
>>>> Thanks,
>>>> Shawn
>>>>
>>
>>