Need help to finalize my autocomplete

2009-09-16 Thread Vincent Pérès

Hello,

I'm using the following code for my autocomplete feature :

The field type :

fieldType name=autoComplete class=solr.TextField omitNorms=true
  analyzer
tokenizer class=solr.WhitespaceTokenizerFactory /
filter class=solr.LowerCaseFilterFactory /
filter class=solr.EdgeNGramFilterFactory maxGramSize=20
minGramSize=2 /
  /analyzer
  analyzer type=query
tokenizer class=solr.WhitespaceTokenizerFactory /
filter class=solr.LowerCaseFilterFactory /
filter class=solr.PatternReplaceFilterFactory
pattern=^(.{20})(.*)? replacement=$1 replace=all /
  /analyzer
/fieldType

The field :

dynamicField name=*_ac type=autoComplete indexed=true stored=true
/

The query :
?q=*:*fq=query_ac:harry*wt=jsonrows=15start=0fl=*indent=onfq=model:SearchQuery

It gives me a list of results I can parse and use with jQuery autocomplete
plugin and all that works very well.

Example of results :
 harry
 harry potter
 the last fighting harry
 harry potter 5
 comic relief harry potter

What I would like to do now is only to have results starting with the query,
so it should be :
 harry
 harry potter
 harry potter 5

Can anybody tell me if it is possible and so how to do it ?

Thank you !
Vincent
And 
-- 
View this message in context: 
http://www.nabble.com/Need-help-to-finalize-my-autocomplete-tp25468885p25468885.html
Sent from the Solr - User mailing list archive at Nabble.com.



Re: Need help to finalize my autocomplete

2009-09-16 Thread Avlesh Singh
Instead of tokenizer class=solr.WhitespaceTokenizerFactory / use
tokenizer class=solr.KeywordTokenizerFactory/

Cheers
Avlesh

2009/9/16 Vincent Pérès vincent.pe...@gmail.com


 Hello,

 I'm using the following code for my autocomplete feature :

 The field type :

fieldType name=autoComplete class=solr.TextField omitNorms=true
  analyzer
tokenizer class=solr.WhitespaceTokenizerFactory /
filter class=solr.LowerCaseFilterFactory /
filter class=solr.EdgeNGramFilterFactory maxGramSize=20
 minGramSize=2 /
  /analyzer
  analyzer type=query
tokenizer class=solr.WhitespaceTokenizerFactory /
filter class=solr.LowerCaseFilterFactory /
filter class=solr.PatternReplaceFilterFactory
 pattern=^(.{20})(.*)? replacement=$1 replace=all /
  /analyzer
/fieldType

 The field :

 dynamicField name=*_ac type=autoComplete indexed=true stored=true
 /

 The query :

 ?q=*:*fq=query_ac:harry*wt=jsonrows=15start=0fl=*indent=onfq=model:SearchQuery

 It gives me a list of results I can parse and use with jQuery autocomplete
 plugin and all that works very well.

 Example of results :
  harry
  harry potter
  the last fighting harry
  harry potter 5
  comic relief harry potter

 What I would like to do now is only to have results starting with the
 query,
 so it should be :
  harry
  harry potter
  harry potter 5

 Can anybody tell me if it is possible and so how to do it ?

 Thank you !
 Vincent
 And
 --
 View this message in context:
 http://www.nabble.com/Need-help-to-finalize-my-autocomplete-tp25468885p25468885.html
 Sent from the Solr - User mailing list archive at Nabble.com.




Re: Need help to finalize my autocomplete

2009-09-16 Thread Vincent Pérès

Hello,

I tried to replace the class as you suggested, but I still get the same
result (and not results where the query start only with the giving query).

fieldType name=autoComplete class=solr.TextField omitNorms=true
  analyzer
tokenizer class=solr.KeywordTokenizerFactory /
filter class=solr.LowerCaseFilterFactory /
filter class=solr.EdgeNGramFilterFactory maxGramSize=20
minGramSize=2 /
  /analyzer
  analyzer type=query
tokenizer class=solr.KeywordTokenizerFactory /
filter class=solr.LowerCaseFilterFactory /
filter class=solr.PatternReplaceFilterFactory
pattern=^(.{20})(.*)? replacement=$1 replace=all /
  /analyzer
/fieldType
-- 
View this message in context: 
http://www.nabble.com/Need-help-to-finalize-my-autocomplete-tp25468885p25469239.html
Sent from the Solr - User mailing list archive at Nabble.com.



Re: Need help to finalize my autocomplete

2009-09-16 Thread Shalin Shekhar Mangar
2009/9/16 Vincent Pérès vincent.pe...@gmail.com


 Hello,

 I tried to replace the class as you suggested, but I still get the same
 result (and not results where the query start only with the giving query).


Make sure you re-index your documents after change the schema.

-- 
Regards,
Shalin Shekhar Mangar.


Re: Need help to finalize my autocomplete

2009-09-16 Thread Vincent Pérès

After re-indexing it works very well ! Thanks a lot !

Vincent
-- 
View this message in context: 
http://www.nabble.com/Need-help-to-finalize-my-autocomplete-tp25468885p25469931.html
Sent from the Solr - User mailing list archive at Nabble.com.