# Optional text

**URL:** <https://discuss.elastic.co/t/optional-text/13012>\
**Category:** Elasticsearch\
**Created:** [July 31, 2013, 8:51am UTC](https://discuss.elastic.co/t/optional-text/13012 "2013-07-31T08:51:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adit](https://avatars.discourse-cdn.com/v4/letter/a/c57346/32.png) [@adit](https://discuss.elastic.co/u/adit)\
**Post date:** [July 31, 2013, 8:51am UTC](https://discuss.elastic.co/t/optional-text/13012/1 "2013-07-31T08:51:35Z")

</div>

Hi guys! 🙂

As I'm starting digging a bit deeper into ES, I found myself in this  
situation: how to ask for some text to boost but not exlude any document if  
it doesnt find anything?

Please consider this example:

- "required text" is the only required match  
[  
{ id: 1, desc: 'some good red required text blabla' },  
{ id: 2, desc: 'some great red required text blabla' },  
{ id: 3, desc: 'some good blue required text blabla' }  
{ id: 4, desc: 'here really nothing' },  
]

I could query like this:

- required text AND blue OR great

But what about these cases?:

- OR blue OR great
- AND required text OR blue
- OR blue AND required text
- OR blue

Please note these are not terms and I'd like to query them through snowball  
analyzer or similar

Any thoughts?!  
Thanks and regards, Adit

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:23am UTC](https://discuss.elastic.co/t/optional-text/13012/2 "2017-07-06T02:23:34Z")

</div>

Closed on July 6, 2017, 2:23am UTC


