# How to set solr default operator

**URL:** <https://forum.xwiki.org/t/how-to-set-solr-default-operator/8937>\
**Category:** Help / Discuss\
**Tags:** search, solr\
**Created:** [June 27, 2021, 4:28pm UTC](https://forum.xwiki.org/t/how-to-set-solr-default-operator/8937 "2021-06-27T16:28:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![helena](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/h/c68b51/32.png) [@helena](https://forum.xwiki.org/u/helena)\
**Post date:** [June 27, 2021, 4:28pm UTC](https://forum.xwiki.org/t/how-to-set-solr-default-operator/8937/1 "2021-06-27T16:28:48Z")

</div>

Hi,

I’m trying to set the default solr search operator for all searches to AND, but I can’t figure out how.  
I came across [this documentation](https://extensions.xwiki.org/xwiki/bin/view/Extension/Solr%20Search%20Query%20API#HStandardSearchParameters), so I think I need to set q.op to AND, but where?

Any ideas?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![helena](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/h/c68b51/32.png) [@helena](https://forum.xwiki.org/u/helena)\
**Post date:** [January 17, 2022, 8:49pm UTC](https://forum.xwiki.org/t/how-to-set-solr-default-operator/8937/2 "2022-01-17T20:49:04Z")

</div>

Hi.

I’ll try again with an example:

Our users use lot of tags in our wiki and when they search for “cookies coffee”, they expect to see pages that have both tags, “cookies” AND “coffee”, but they get pages that have either one of the tags or both of them.  
They could type “cookies+coffee” to get the desired result, but that’s just not what most people do.

If AND was the default search operator, our users would get the results they expect, but I could not figure out a way to set it.  
I tried to set q.op to AND for the /select solr.SearchHandler in solrconfig.xml but the search results stayed the same.

Does anyone know, where to set the default search operator? Is this even the right way to achieve what I described in the example?

Thanks.

---

<div class="post-metadata">

**Author:** ![mflorea](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mflorea/32/49_2.png) [@mflorea](https://forum.xwiki.org/u/mflorea)\
**Post date:** [January 18, 2022, 9:22am UTC](https://forum.xwiki.org/t/how-to-set-solr-default-operator/8937/3 "2022-01-18T09:22:52Z")

</div>

You could also try the `mm` parameter [The DisMax Query Parser | Apache Solr Reference Guide 8.3](https://solr.apache.org/guide/8_3/the-dismax-query-parser.html#mm-minimum-should-match-parameter) . Edit `Main.SolrSearchConfig` and look for `minShouldMatch`.

---

<div class="post-metadata">

**Author:** ![helena](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/h/c68b51/32.png) [@helena](https://forum.xwiki.org/u/helena)\
**Post date:** [January 18, 2022, 12:05pm UTC](https://forum.xwiki.org/t/how-to-set-solr-default-operator/8937/4 "2022-01-18T12:05:44Z")

</div>

Thanks for you answer. I’ve already set

```auto
  'minShouldMatch': '100%',

```

but the search results stay the same.
