# Real time match analysis

**URL:** <https://discuss.elastic.co/t/real-time-match-analysis/21571>\
**Category:** Elasticsearch\
**Created:** [January 11, 2015, 6:38am UTC](https://discuss.elastic.co/t/real-time-match-analysis/21571 "2015-01-11T06:38:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ed\_Kim](https://avatars.discourse-cdn.com/v4/letter/e/53a042/32.png) [@Ed\_Kim](https://discuss.elastic.co/u/Ed_Kim)\
**Post date:** [January 11, 2015, 6:38am UTC](https://discuss.elastic.co/t/real-time-match-analysis/21571/1 "2015-01-11T06:38:34Z")

</div>

Hello all, I was wondering if anyone could offer some feedback on whether  
there is a way to determine how a document matched in real time. I  
currently use custom analyzers at index time to allow a broad array of  
matches for a given text field. I try to match based on phrases, synonyms,  
substrings, stemming, etc of a given phrase, and I would like to be able to  
figure out at search time, which analyzer was attributed to causing the  
match.

Currently, I've gotten around this by creating child documents where the  
fields are fanned out to their respective analyzer types. So I have a child  
document where the field only applies stemming, another that uses only  
synonyms, etc. However, due to the growing number of fields that require  
analysis and the growth of my data set, I'd much prefer if I had less  
documents (and less complex too). I was hoping there would be a way to tag  
tokens at the analysis phase that could be used at the search phase to  
quickly determine my match level, but I was not able to find anything like  
this.

Having said that, has anyone else ever tried to figure this out, or have an  
thoughts on how to leverage ES at a lower level to determine match?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4222f994-d448-4b61-a71e-3dca03a5a0fc%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4222f994-d448-4b61-a71e-3dca03a5a0fc%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ed\_Kim](https://avatars.discourse-cdn.com/v4/letter/e/53a042/32.png) [@Ed\_Kim](https://discuss.elastic.co/u/Ed_Kim)\
**Post date:** [January 14, 2015, 8:24pm UTC](https://discuss.elastic.co/t/real-time-match-analysis/21571/2 "2015-01-14T20:24:33Z")

</div>

Just a friendly bump to see if anyone has any feedback. 🙂

On Saturday, January 10, 2015 at 10:38:34 PM UTC-8, Ed Kim wrote:

> Hello all, I was wondering if anyone could offer some feedback on whether  
> there is a way to determine how a document matched in real time. I  
> currently use custom analyzers at index time to allow a broad array of  
> matches for a given text field. I try to match based on phrases, synonyms,  
> substrings, stemming, etc of a given phrase, and I would like to be able to  
> figure out at search time, which analyzer was attributed to causing the  
> match.
> 
> Currently, I've gotten around this by creating child documents where the  
> fields are fanned out to their respective analyzer types. So I have a child  
> document where the field only applies stemming, another that uses only  
> synonyms, etc. However, due to the growing number of fields that require  
> analysis and the growth of my data set, I'd much prefer if I had less  
> documents (and less complex too). I was hoping there would be a way to tag  
> tokens at the analysis phase that could be used at the search phase to  
> quickly determine my match level, but I was not able to find anything like  
> this.
> 
> Having said that, has anyone else ever tried to figure this out, or have  
> an thoughts on how to leverage ES at a lower level to determine match?

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/eab16b7d-7d98-4096-b853-66ef65376c44%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/eab16b7d-7d98-4096-b853-66ef65376c44%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [January 14, 2015, 8:50pm UTC](https://discuss.elastic.co/t/real-time-match-analysis/21571/3 "2015-01-14T20:50:40Z")

</div>

What about explain?

On Wed, Jan 14, 2015 at 3:24 PM, Ed Kim [edkim81@gmail.com](mailto:edkim81@gmail.com) wrote:

> Just a friendly bump to see if anyone has any feedback. 🙂
> 
> On Saturday, January 10, 2015 at 10:38:34 PM UTC-8, Ed Kim wrote:
> 
> > Hello all, I was wondering if anyone could offer some feedback on whether  
> > there is a way to determine how a document matched in real time. I  
> > currently use custom analyzers at index time to allow a broad array of  
> > matches for a given text field. I try to match based on phrases, synonyms,  
> > substrings, stemming, etc of a given phrase, and I would like to be able to  
> > figure out at search time, which analyzer was attributed to causing the  
> > match.
> > 
> > Currently, I've gotten around this by creating child documents where the  
> > fields are fanned out to their respective analyzer types. So I have a child  
> > document where the field only applies stemming, another that uses only  
> > synonyms, etc. However, due to the growing number of fields that require  
> > analysis and the growth of my data set, I'd much prefer if I had less  
> > documents (and less complex too). I was hoping there would be a way to tag  
> > tokens at the analysis phase that could be used at the search phase to  
> > quickly determine my match level, but I was not able to find anything like  
> > this.
> > 
> > Having said that, has anyone else ever tried to figure this out, or have  
> > an thoughts on how to leverage ES at a lower level to determine match?
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/eab16b7d-7d98-4096-b853-66ef65376c44%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/eab16b7d-7d98-4096-b853-66ef65376c44%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/eab16b7d-7d98-4096-b853-66ef65376c44%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/eab16b7d-7d98-4096-b853-66ef65376c44%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1pNm54NvP-ex7Poyjp4RgNf%3DWgT98YDthGVcyrh2FevQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1pNm54NvP-ex7Poyjp4RgNf%3DWgT98YDthGVcyrh2FevQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ed\_Kim](https://avatars.discourse-cdn.com/v4/letter/e/53a042/32.png) [@Ed\_Kim](https://discuss.elastic.co/u/Ed_Kim)\
**Post date:** [January 15, 2015, 7:25pm UTC](https://discuss.elastic.co/t/real-time-match-analysis/21571/4 "2015-01-15T19:25:00Z")

</div>

I was able to identify which field matched via explain, but couldn't see  
any information on which token filter was the reason for the match. I've  
tried specifying the analyzer name that the field uses as well as not  
specifying. If the explain is supposed to provide this data, I will give it  
another go and set up a test index with simpler analyzer setups.

Also, in order to do this, I will need to run the explain separate from the  
search itself. My ultimate goal is to be able to do this within  
milliseconds (less than 10). Is this feasible with explain?

On Wednesday, January 14, 2015 at 12:51:15 PM UTC-8, Nikolas Everett wrote:

> What about explain?
> 
> On Wed, Jan 14, 2015 at 3:24 PM, Ed Kim \<[edk...@gmail.com](mailto:edk...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > Just a friendly bump to see if anyone has any feedback. 🙂
> > 
> > On Saturday, January 10, 2015 at 10:38:34 PM UTC-8, Ed Kim wrote:
> > 
> > > Hello all, I was wondering if anyone could offer some feedback on  
> > > whether there is a way to determine how a document matched in real time. I  
> > > currently use custom analyzers at index time to allow a broad array of  
> > > matches for a given text field. I try to match based on phrases, synonyms,  
> > > substrings, stemming, etc of a given phrase, and I would like to be able to  
> > > figure out at search time, which analyzer was attributed to causing the  
> > > match.
> > > 
> > > Currently, I've gotten around this by creating child documents where the  
> > > fields are fanned out to their respective analyzer types. So I have a child  
> > > document where the field only applies stemming, another that uses only  
> > > synonyms, etc. However, due to the growing number of fields that require  
> > > analysis and the growth of my data set, I'd much prefer if I had less  
> > > documents (and less complex too). I was hoping there would be a way to tag  
> > > tokens at the analysis phase that could be used at the search phase to  
> > > quickly determine my match level, but I was not able to find anything like  
> > > this.
> > > 
> > > Having said that, has anyone else ever tried to figure this out, or have  
> > > an thoughts on how to leverage ES at a lower level to determine match?
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/eab16b7d-7d98-4096-b853-66ef65376c44%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/eab16b7d-7d98-4096-b853-66ef65376c44%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/eab16b7d-7d98-4096-b853-66ef65376c44%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/eab16b7d-7d98-4096-b853-66ef65376c44%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/326aca97-d937-41cc-9c28-7f89aa398c81%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/326aca97-d937-41cc-9c28-7f89aa398c81%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:38am UTC](https://discuss.elastic.co/t/real-time-match-analysis/21571/5 "2017-07-06T00:38:36Z")

</div>


