# Add pre-analyzed documents in Elasticsearch

**URL:** https://discuss.elastic.co/t/add-pre-analyzed-documents-in-elasticsearch/11765
**Category:** Elasticsearch
**Created:** [May 1, 2013, 1:08pm UTC](https://discuss.elastic.co/t/add-pre-analyzed-documents-in-elasticsearch/11765 "2013-05-01T13:08:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Cristiano\_Lima](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cristiano_lima/32/2363_2.png) [@Cristiano\_Lima](https://discuss.elastic.co/u/Cristiano_Lima)
#### Post date: [May 1, 2013, 1:08pm UTC](https://discuss.elastic.co/t/add-pre-analyzed-documents-in-elasticsearch/11765/1 "2013-05-01T13:08:53Z")

</div>

Hi All,

I have some text that has been pre-analyzed (tokenized, stemmed, stopword  
filtered, and the term frequency has been counted). So, for the text  
"Example text has twice the word twice", I have "(example, 1), (text, 1),  
(twice, 2), (word, 1)".  
How can I add this to ElasticSearch?  
I could just repeat the tokens and have them re-analyzed, or I could create  
my own analyzer for this format, or I could try to directly access the term  
vectors.  
I assume that The Right Way would be the last option, but I don't know how  
to do it. Any ideas?

[]`s  
Cristiano.

--  
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: ![taras](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/taras/32/507_2.png) [@taras](https://discuss.elastic.co/u/taras)
#### Post date: [May 1, 2013, 6:58pm UTC](https://discuss.elastic.co/t/add-pre-analyzed-documents-in-elasticsearch/11765/2 "2013-05-01T18:58:13Z")

</div>

If you're adding text the regular way, then you get extra meta data such as  
position. So if you care only about term vector like you outlined, then you  
might want basic term queries not the regular text search. If you intend to  
do text searches then you'll need a matching query analyzer.

Without fully understanding your usecase, I sense you're better off with  
writing your own tokenizer and just not applying any fancy filters to it.

On Wednesday, May 1, 2013 6:08:53 AM UTC-7, Cristiano Lima wrote:

> Hi All,
> 
> I have some text that has been pre-analyzed (tokenized, stemmed, stopword  
> filtered, and the term frequency has been counted). So, for the text  
> "Example text has twice the word twice", I have "(example, 1), (text, 1),  
> (twice, 2), (word, 1)".  
> How can I add this to Elasticsearch?  
> I could just repeat the tokens and have them re-analyzed, or I could  
> create my own analyzer for this format, or I could try to directly access  
> the term vectors.  
> I assume that The Right Way would be the last option, but I don't know how  
> to do it. Any ideas?
> 
> `s  
> Cristiano.

--  
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:38am UTC](https://discuss.elastic.co/t/add-pre-analyzed-documents-in-elasticsearch/11765/3 "2017-07-06T02:38:46Z")

</div>


