# Support for pre-analyzed fields?

**URL:** <https://discuss.elastic.co/t/support-for-pre-analyzed-fields/11677>\
**Category:** Elasticsearch\
**Created:** [April 24, 2013, 12:54am UTC](https://discuss.elastic.co/t/support-for-pre-analyzed-fields/11677 "2013-04-24T00:54:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Dlug](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Paul\_Dlug](https://discuss.elastic.co/u/Paul_Dlug)\
**Post date:** [April 24, 2013, 12:54am UTC](https://discuss.elastic.co/t/support-for-pre-analyzed-fields/11677/1 "2013-04-24T00:54:55Z")

</div>

Does elasticsearch support pre-analyzed fields [1]? Basically having the  
client provide the stored value and the token stream. I have a few use  
cases where this would be helpful.

1. [http://wiki.apache.org/solr/PreAnalyzedField](http://wiki.apache.org/solr/PreAnalyzedField)

--  
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:** ![Paul\_Dlug](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Paul\_Dlug](https://discuss.elastic.co/u/Paul_Dlug)\
**Post date:** [May 9, 2013, 3:18pm UTC](https://discuss.elastic.co/t/support-for-pre-analyzed-fields/11677/2 "2013-05-09T15:18:49Z")

</div>

Just wondering if anyone had any thoughts on this or where I might begin in  
implementing a plugin to implement this capability.

Thanks,  
Paul

On Tuesday, April 23, 2013 8:54:55 PM UTC-4, Paul Dlug wrote:

> Does elasticsearch support pre-analyzed fields [1]? Basically having the  
> client provide the stored value and the token stream. I have a few use  
> cases where this would be helpful.
> 
> 1. [PreAnalyzedField - Solr - Apache Software Foundation](http://wiki.apache.org/solr/PreAnalyzedField)

--  
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:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [May 9, 2013, 3:29pm UTC](https://discuss.elastic.co/t/support-for-pre-analyzed-fields/11677/3 "2013-05-09T15:29:00Z")

</div>

Not quite the same, but I analyze query terms for queries that do not  
support analysis (SpanBuilders) using analyzers derived from the  
AnalysisModule.

PreAnalyzedFields look interesting, but I am wondering why it is a Solr  
class and not Lucene.

--  
Ivan

On Thu, May 9, 2013 at 8:18 AM, Paul Dlug [paul.dlug@gmail.com](mailto:paul.dlug@gmail.com) wrote:

> Just wondering if anyone had any thoughts on this or where I might begin  
> in implementing a plugin to implement this capability.
> 
> Thanks,  
> Paul
> 
> On Tuesday, April 23, 2013 8:54:55 PM UTC-4, Paul Dlug wrote:
> 
> > Does elasticsearch support pre-analyzed fields [1]? Basically having the  
> > client provide the stored value and the token stream. I have a few use  
> > cases where this would be helpful.
> > 
> > 1. [http://wiki.apache.org/solr/\*\*PreAnalyzedField](http://wiki.apache.org/solr/**PreAnalyzedField)[http://wiki.apache.org/solr/PreAnalyzedField](http://wiki.apache.org/solr/PreAnalyzedField)
> 
> --  
> 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).

--  
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:** ![Erik\_Fassler\_2](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@Erik\_Fassler\_2](https://discuss.elastic.co/u/Erik_Fassler_2)\
**Post date:** [June 8, 2013, 3:48pm UTC](https://discuss.elastic.co/t/support-for-pre-analyzed-fields/11677/4 "2013-06-08T15:48:27Z")

</div>

Because in Lucene you can already do this: You just create two fields of  
the same name, the first stored but not indexed with the text contents, the  
second with the content you would like to have indexed. You can, for  
example, merge multiple token streams into one field using this trick. The  
first could be the normal analyzed sequence of words derived from the  
original text, the second could be an externally computed sequence of tags  
like part-of-speech or entity annotations or some other analysis too  
advanced for the standard lucene analyzers.  
Then, the field can be searched using the analyzed terms but you can still  
get the original text and even highlight it etc. For example, you could  
search for "verb" and get all verbs highlighted in the original text (given  
your analyzed token stream has appropriate offsets and position\_increments).  
I'm currently looking for the same thing, which is way I digged out this  
post. If anyone knows more about it, I'd really like to hear it.

On Thursday, 9 May 2013 17:29:00 UTC+2, Ivan Brusic wrote:

> Not quite the same, but I analyze query terms for queries that do not  
> support analysis (SpanBuilders) using analyzers derived from the  
> AnalysisModule.
> 
> PreAnalyzedFields look interesting, but I am wondering why it is a Solr  
> class and not Lucene.
> 
> --  
> Ivan
> 
> On Thu, May 9, 2013 at 8:18 AM, Paul Dlug \<[paul...@gmail.com](mailto:paul...@gmail.com) \<javascript:\>
> 
> > wrote:
> 
> > Just wondering if anyone had any thoughts on this or where I might begin  
> > in implementing a plugin to implement this capability.
> > 
> > Thanks,  
> > Paul
> > 
> > On Tuesday, April 23, 2013 8:54:55 PM UTC-4, Paul Dlug wrote:
> > 
> > > Does elasticsearch support pre-analyzed fields [1]? Basically having the  
> > > client provide the stored value and the token stream. I have a few use  
> > > cases where this would be helpful.
> > > 
> > > 1. [http://wiki.apache.org/solr/\*\*PreAnalyzedField](http://wiki.apache.org/solr/**PreAnalyzedField)[http://wiki.apache.org/solr/PreAnalyzedField](http://wiki.apache.org/solr/PreAnalyzedField)
> > 
> > --  
> > 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:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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:32am UTC](https://discuss.elastic.co/t/support-for-pre-analyzed-fields/11677/5 "2017-07-06T02:32:10Z")

</div>


