First off: i would suggest that instead of doing a simple prefix search, 
you look into using EdgeNGrams for this sort of thing.

I'm also assuming since you need custom scoring for this, you aren't going 
to get what you need using the TermsComponent or any other simple solution 
using your main corpus -- it would make more sense to setup a special 
index consisting of one document per "term" to include in your 
autosuggest.

: > 1. Results matching field1 should be ranked higher. Results matching the

easily done with dismax .. even if you are using EdgeNGrams (just make 
sure you have EdgeNGrams on at index time, but not at query time)

: > 2.The next sort parameter is the length of the word. So, if you are
: > searching for IR, Row2 (2 out of 4 ) matches higher than Row3 (2 out of 5).

this can be accomplished by indexing a numeric field containing the 
"length" of the field as a number, and then doing a secondary sort on it.  
the fieldNorm typically takes care of this sort of thing for you, but is 
more of a generalized concept, and doesn't give you exact precision for 
small numbers.


-Hoss

Reply via email to