Most query parsers don't support wildcards in phrases. Do you really need phrase matches in your article numbers? If so you might need to experiment with the ComplexPhraseQueryParser <https://solr.apache.org/guide/solr/latest/query-guide/other-parsers.html#complex-phrase-query-parser>. Your examples look like they don't need that complexity and could even work without the wordDelimiterGraph filter or even with a simple String field.
Matthias On Wed, Apr 10, 2024 at 11:40 AM Carsten Klement <kont...@carsten-klement.de> wrote: > Hello, > > > > I think I have a problem with configured Word separators. > > > > For example, I would like 3 items to be found when searching for 640, > 640-0 and two when searching for 640-01. > > > > #1 > > artikelnummer_txt:"640*" AND lng:"de" > > "docs":[{ > > "artikelnummer_txt":"640-01" > > },{ > > "artikelnummer_txt":"640-02" > > },{ > > "artikelnummer_txt":"640-01LFM" > > }] > > This is perfect, everything from the “artikelnummer_txt” field that > starts with 640 will be found. > > > > #2 > > artikelnummer_txt:"640-0*" AND lng:"de" > > "docs":[ ] > > > > However, if I enter a "-" with a "0", no article is found. Here I expect > all three items > > > > #3 > > artikelnummer_txt:"640-01*" AND lng:"de" > > "docs":[{ > > "artikelnummer_txt":"640-01" > > }] > > > > Here I only get one item, but I also expect two items. > > > > My configuration in schema.xml > > <dynamicField name="*_txt" type="text_general" indexed="true" > stored="true"/> > > <fieldType name="text_general" class="solr.TextField" > positionIncrementGap="100" multiValued="false"> > > <analyzer type="index"> > > <tokenizer name="standard"/> > > <filter ignoreCase="true" words="stopwords.txt" name="stop"/> > > <filter name="lowercase"/> > > </analyzer> > > <analyzer type="query"> > > <tokenizer name="standard"/> > > <!-- Test START --> > > <filter name="wordDelimiterGraph" types="wordDelimiters.txt"/> > > <filter name="flattenGraph"/> > > <!-- Test ENDE --> > > <filter ignoreCase="true" words="stopwords.txt" name="stop"/> > > <filter ignoreCase="true" synonyms="synonyms.txt" > name="synonymGraph" expand="true"/> > > <filter name="lowercase"/> > > </analyzer> > > </fieldType> > > > > ### wordDelimiters.txt > > # Don't split numbers at '$', '.' or ',' > > $ => DIGIT > > . => DIGIT > > - => ALPHANUM > > > > Maybe someone has an idea what I'm doing wrong? > > Thanks > > Carsten > > > >