java - Error searching *n@domain* in apache solr -


field defination

<field name="email" type="text_general" indexed="true" stored="true" />      

query

email : "*n@domain*"     

result

no data.

my question have data indexed in solr matching criteria. not reflecting in query results. there issue query pattern.

i'm guessing don't have text *n@domain* in you're field. rather have n@domain somewhere in middle of term (or believe). there few problems run into. assume field uses standardanalyzer.

first, no wildcards in phrase queries. field:"query terms" phrase query, meaning match can span multiple (post-analysis) terms. query parser syntax not include support of wildcards in phrase queries. such asterisks in query that, literal asterisks.

second, searching email:*n@domain*, better, still no luck. wildcard queries bypass analysis, , chances email analyzed in index. entry like: "test@domain.com", ave 3 terms "test", "domain" , "com". can make field un-analyzed search have indicated here, that's determine if correct approach.

once you've got worked out, may have working, may notice performance if terrible. leading wildcard disabled default, because lead awful performance, since require linear scan of terms in order enumerate matches, rather making effective use of index. there strategies allow leading wildcards without brutal hit performance, such reversedwildcardfilter


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -