last day (14 days later) » 

6:50 PM
0
A: Solr search with reversed term?

MysterionI think your analyzer chain is fine. What it will produce for "Iron Maiden" is following - "iron" "maiden" To be able to find it in both straightforward and reverse way you just need to apply proper query. Phrase/Span query will do the trick. Possible solution: name:"Iron Maiden" and name:"Ma...

 
What amount name:maiden+iron ???
 
sorry, that was answer, that I've prepared before I asked question about your queries
 
Query analyzer is the same. :) I'll edit the question.
 
@user432024, so what you got when you search with one of your queries? and what's expected output? please share schema.xml and sample docs, that you've tested
 
As a term search name:"Iron Maiden" vs name:"Maiden Iron" only name:"Iron Maiden" works. If not as phrase search name:Iron+Maiden vs name:Maiden+Iron both work.
 
6:50 PM
so you do not want to change query, but rather change analyzer chain?
it looks like i clearly don't get your question
you want to do a term search iron maiden and maiden iron without phrase search?
 
i mean is it a problem for you to do "maiden iron"~1
and "iron maiden"~1 if you want to match both iron maiden and maiden iron
 
I guess no... what does ~1 i need to read up on this
 
i could explain
it's just a proximity search
so it will match
iron maiden, iron anyword maiden and maiden iron
 
Ok but... name:"Maiden Iron"~1 does not
 
6:58 PM
does not what?
 
Match any docs
<field name="name" type="textArtist" indexed="true" required="true" stored="true" multiValued="false"/>


<fieldType class="solr.TextField" name="textArtist" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.ClassicTokenizerFactory"/>
<filter class="solr.ClassicFilterFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.ClassicTokenizerFactory"/>
 
"maiden iron"~1 works?
 
so name:"Maiden Iron"~1. Nope it returns 0 docs but name:Maiden+Iron does
 
name:Maiden+Iron will be transformed in something completely different
which docs it returns?
 
name:"Maiden Iron"~1 returns nothing, zero documents.
name:"Iron Maiden"~1 returns all docsuments that have Iron Maiden them like: fans de iron maiden, IRON MAIDEN CHILE, Iron Maiden
 
7:05 PM
hm
"maiden iron"~2?
 
Yep that works
 
okay, so, problem solved?
 
I guess so! But what the difference between Maiden+Iron and "Maiden Iron"~2
 
i will update query to ~2 and you will upvote it?
 
Yeah :)
 
7:09 PM
i'm sure that it will produce different queries
name:Maiden+Iron i think will provide query like this:
name:Maiden OR *:Iron
 
lol is there an explanation to why? Is it because Maiden+Iron search for each term individually?
Oh so Iron will be search under default field?
 
i think so
explanation for this one - lucene query parser
that's the rule
 
ok thanks
You still there?
 
yes
 
Ok so...
query debug return this...

"rawquerystring": "artist_name:Maiden+Iron",
"querystring": "artist_name:Maiden+Iron",
"parsedquery": "artist_name:maiden artist_name:iron",
"parsedquery_toString": "artist_name:maiden artist_name:iron"
So it's like doing an OR
 
7:21 PM
okay
i was a bit wrong
or your default field is artist_name
 
No just trying to hide my domain model oops lol
"rawquerystring": "artist_name:\"Maiden Iron\"~2",
"querystring": "artist_name:\"Maiden Iron\"~2",
"parsedquery": "PhraseQuery(artist_name:\"maiden iron\"~2)",
"parsedquery_toString": "artist_name:\"maiden iron\"~2",
 
i see
 

last day (14 days later) »