简体   繁体   中英

Lucene and forward slash

In my index there is a value companyName:opel/vauxhall
Searching for "opel/vauxhall" returns the correct results.
Searching for "opel/*" returns nothing.

Currently I'm replacing the '/' with spaces. But that does give my code a bit of a smell.

Any better ideas?

This kind of problem is almost always caused by the analyzer used for indexing and searching (parsing the query).

Try using a different analyzer, for example StopAnalyzer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM