# Lucene Document Field Tokens

**URL:** <https://community.developer.atlassian.com/t/lucene-document-field-tokens/30597>\
**Category:** Jira Server\
**Tags:** lucene\
**Created:** [July 23, 2019, 5:46pm UTC](https://community.developer.atlassian.com/t/lucene-document-field-tokens/30597 "2019-07-23T17:46:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![linklefebvre](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/linklefebvre/32/49416_2.png) [@linklefebvre](https://community.developer.atlassian.com/u/linklefebvre)\
**Post date:** [July 23, 2019, 5:46pm UTC](https://community.developer.atlassian.com/t/lucene-document-field-tokens/30597/1 "2019-07-23T17:46:02Z")

</div>

I was wondering if any other developers had to use a custom Analyzer / Tokenizer or simply custom Tokens for their Lucene Document Fields.

We have a field let’s say “Car List” which would benefit from indexing the car “Brand”, “Name” and “Color” all in one field.

Our goal is to index three tokens in one field: “General Motors”, “Acadia”, “Dark Blue”.  
If we index as a text field, it will create a token for “General”, “Motors”, “Acadia”, “Dark”, “Blue”.  
This will return result if searching for a Blue General Acadia (which we don’t want to return results, only for Dark Blue General Motors Acadia).

If you had a similar situation, how did you guys implement it?

Thanks for your time.

---

<div class="post-metadata">

**Author:** ![linklefebvre](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/linklefebvre/32/49416_2.png) [@linklefebvre](https://community.developer.atlassian.com/u/linklefebvre)\
**Post date:** [July 24, 2019, 5:06pm UTC](https://community.developer.atlassian.com/t/lucene-document-field-tokens/30597/2 "2019-07-24T17:06:57Z")

</div>

What we ended up doing is creating our own `TokenStream` that builds a Field with the three tokens `General Motors` , `Acadia` and `Dark Blue`.

When searching using a PhraseQuery, we were able to search by exact token in the index.
