Erik,

thank you for responsing.
I will check the code to get some ideas for implementation. 

I do need some cached ressources like the CharArraySet of protected words
for a WordDelimiterFilter (for the MAX_LEN-parameter mentioned by Hoss) or a
SynonymFilter . 
I think it would consume too much time to retrive these information again
and again everytime I do a query. That's why Solr uses FilterFactories,
since they are storing these information for queries.

I will try to explain what I want to do. Perhaps my english explanation is
not good, so if you feel so, please ask.
I want to extend QueryParser to 
a) create the the MAX_LEN - param
b) making multiWordSynonyms possible at query-time.

I think b) is a little bit tricky.
At query-time multi-word synonyms is not possible, - as I have understood -
because of the way a querystring get's parsed by a QueryParser.
However, what would be, if I modify the querystr at parsing time?
Imagine what would be if I replace for example "my four word synonym" with
"SOLRSYN_ID589"?

I think this is possible, if I do the following:
- creating a StringReader(querystr)
- tokenize and filter the querystr (it is the same work like an analyzer
does in Lucene)
- put the result in the ToStringTokenFilter (the ToStringTokenFilter needs a
field like "String newQuerystr")
- retrive the newQueryStr (ToStringTokenFilter.newQuerystr) and go on
working with it as you would normaly do

Pros:
- making MultiWordSynonyms at query-time possible

Cons:
- *every* field has to implement a SynonymFilter which retrives those
synonyms which belong to - in my example - SOLRSYN_ID589. I *think* this
makes querying against StringFields impossible, if there is a synonym. 

How does a synonym.txt has to looks like? 
index_synonyms.txt -> as normally given by the example (you can do whatever
you want)
query_synonyms.txt -> has to look different:
-------------------------------------------
SOLRSYN_ID589 => my other example, a word, another word, three word example
etc.

Maybe one needs to implement another SynonymFilter with another synonyms.txt
normal_synonyms.txt
I think my example is bad, but I hope it explains what I mean:
another word => theater, nightclub

This is a really large overhead, however it makes multiword-synonyms
possible, *if* I am right.
If there are no cons for doing it this way, I will try to implement it next
time.

- Mitch
-- 
View this message in context: 
http://n3.nabble.com/Minimum-Should-Match-the-other-way-round-tp694867p703353.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to