As far as I can tell from your screenshot, your field type is text_general
that uses StandardTokenizerFactory
(like this):
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="false">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/>
<filter class="solr.SynonymFilterFactory" expand="true" ignoreCase="true" synonyms="synonyms.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
Indexing: your { }
characters are ignored by StandardTokenizerFactory
on indexing level and are used to tokenize your text.
I don't see a reason to use text_general
for URLs, why you don't use string
?
If you really need text_general
for your field: best option is to create your own field type with your specific tokenizer behavior (instead of changing text_general
schema). You can use WhiteSpaceTokenizer
, PatternTokenizerFactory
, KeywordTokenizerFactory
depends on your needs instead of StandardTokenizerFactory
.
Quering:
your workaround by using \
for escaping should work for quering. But your text_general
field type uses the same StandardTokenizerFactory
for querying, so your { }
are also escaped from your query.
So, best solution is to change your field type to string
. If you cant do it by some reasons - implement your own field type with needed tokenizers on indexing and querying levels.
P.S. I am not 100% sure for querying with {
, as far as I remember it was a bug in old Sitecore versions with Lucene search that Sitecore force calls Lucene QueryParser.Escape on query time, but I hope it was fixed a long time ago and it works fine with querying without StandardTokenizerFactory.