Note that there are some explanatory texts on larger screens.

plurals
  1. POSearch for parentheses via ElasticSearch
    primarykey
    data
    text
    <p>I have a requirement where i need to index some text that is prefixed with (std) which i should then be able to search for again.</p> <p>Ie. a document (html) contains the following sentence </p> <blockquote> <p>(std)Almindelige betingelser for misligholdelseserstatning</p> </blockquote> <p>and i should be able to query for </p> <blockquote> <p>(std)Almindelige betingelser</p> </blockquote> <p>Now, i've read a whole lot in the documentations and have now a charfilter in place which replaces ( and ) with _, and i thought i would then be safe to just to a replace in the search-query as well, so it becomes </p> <blockquote> <p>_std_Almindelige betingelser</p> </blockquote> <p>but for some reason its simply not working AT ALL. No result at all is being returned when searching for <code>_std_Almindelige betingelser</code> even though i can see the term is there by browsing the document and return a list of facets.</p> <p>This is my index settings and type mapping</p> <pre><code>var settings = new IndexSettings(); settings.Analysis.CharFilters.Add("parenthesis", new MappingCharFilter { Mappings = new[] { "( =&gt; _", ") =&gt; _" } }); settings.Analysis.TokenFilters.Add("snowball", new SnowballTokenFilter { Language = "Danish" }); settings.Analysis.Analyzers.Add("content", new CustomAnalyzer { CharFilter = new List&lt;string&gt;() { "html_strip", "parenthesis" }, Tokenizer = "whitespace", Filter = new List&lt;string&gt;() { "lowercase", "snowball" } }); </code></pre> <p>And the mapping</p> <pre><code>{"searchservicepages":{ "_source":{ "excludes" : ["content"] }, "properties":{ "content":{ "type":"string", "index_analyzer"":"content" } } }} </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload