Skip to content

Conversation

@binarymind
Copy link

just add term_vector with_positions_offsets to the content so that we can later on make highlights in search queries

… can later on make highlights in search queries
@konradkonrad
Copy link
Member

Hey @binarymind, thanks for the PR. I can see, why you want this. However, since this is adding to the index size, I think, it should be configurable (see #11). For now, could you see, if you can achieve what you need with an index-template like the following?

curl -XPUT localhost:9200/_template/template_1 -d '
{
    "template" : "*",
    "mappings" : {
        "doc" : {
            "properties": { 
                "content": { "term_vector": "with_positions_offset" }
        }
    }
}
'

I hope, this is correct, it is untested.. It should translate to
"for indices matching *,
their mapping of the document_type 'doc' will contain a field 'content' that has the "term_vector": "with_positions_offset" setting".

(see www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html)

@binarymind
Copy link
Author

hello, okay that's great i didn't know these template thing (quite noob with es :) ). thanks for your detailed answer if i have to do it again it seems i will indeed do that ! for now i made the modif I showed you and manage to build so that's allright for me. All the best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants