I have a potentially stupid noob question about analyzers.
Is it possible to create an analyzer to populate a specified field in all
records automatically? Specifically, I want to create a field with keywords
based on a text field in that same record. I want to be able to do a check
on which keywords were generated for each record, to verify what the
analyzer is doing. Or do analyzers only work on indexing, and the results
can't be inspected directly?
Also, when an analyzer is applied to an index, does this also apply to
existing records, or do these records need to be reindexed? If so, how is
the reindexing triggered?
On Thursday, November 8, 2012 9:53:54 AM UTC+1, Anton wrote:
Hi all,
I have a potentially stupid noob question about analyzers.
In general an analyzer is usually used per field and the analyzer is used
at index and at query time. So if you index a document elasticsearch
chooses an analyzer and passes your text through the analyzer. The created
tokens are then used to build the inverted index ( Inverted index - Wikipedia). At query time the same thing
happens, we pass the text through the analyzer and build the query based on
the created tokens.
Is it possible to create an analyzer to populate a specified field in all
records automatically? Specifically, I want to create a field with keywords
based on a text field in that same record. I want to be able to do a check
on which keywords were generated for each record, to verify what the
analyzer is doing. Or do analyzers only work on indexing, and the results
can't be inspected directly?
Also, when an analyzer is applied to an index, does this also apply to
existing records, or do these records need to be reindexed? If so, how is
the reindexing triggered?
you can't change your analyzers once they have been configured otherwise we
would need to entriely reindex and that is sometimes not possible ie. if we
need the data from a 3rd party resource. you should configure your analysis
ahead of time. Yet, if you want to get more insight into what happens when
you pass a certain string to ES you can checkout the analyze API ( Elasticsearch Platform — Find real-time answers at scale | Elastic)
that basically applies an analyzer to text and returns you the result as a
json response.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.