Re: Solr Auto-Complete

2015-12-08 Thread Salman Ansari
Thanks Alexandre. I think it is clear. On Sun, Dec 6, 2015 at 5:21 PM, Alexandre Rafalovitch wrote: > For suffix matches, you copy text the field and in the different type add > string reversal for both index and query portions. So you are doing prefix > matching algorithm

Re: Solr Auto-Complete

2015-12-06 Thread Alexandre Rafalovitch
For suffix matches, you copy text the field and in the different type add string reversal for both index and query portions. So you are doing prefix matching algorithm but on reversed strings. I can dig up an example if it is not clear. On 6 Dec 2015 8:06 am, "Salman Ansari"

Re: Solr Auto-Complete

2015-12-06 Thread Andrea Gazzarini
Do you mean "phrase" or "term" prefixes? If you try to put a field value (two or more terms) in the analysis page you will see what the index analyzer chain (of my example field type) is doing. The whole value is managed as a single-ngrammed token, so you will get only a phrase prefix search, as

Re: Solr Auto-Complete

2015-12-06 Thread Salman Ansari
Hi, I have updated my schema.xml as mentioned in the previous posts using This does the auto-complete, but it does it at every portion of the text (not just at the beginning)

Re: Solr Auto-Complete

2015-12-06 Thread Andrea Gazzarini
Hi Salman, that's because you're using a StandardTokenizer. Try with something like this (copied, pasted and changed using my phone so probably with a lot of mistakes ;) but you should be able to get what I mean). BTW I don't know if that's the case but I would also put a MappingCharFilterFactory

Re: Solr Auto-Complete

2015-12-06 Thread Salman Ansari
Thanks a lot Andrea. It did work. However, just for my understanding, can you please explain more how did you make it work for prefixes. I know you mentioned using another Tokenizer but for example, if I want to tweak it later on to work on suffixes or within phrases how should I go about that?

Re: Solr Auto-Complete

2015-12-06 Thread Andrea Gazzarini
Sorry, my damned mobile: "Is that close to what you were looking for?" 2015-12-06 12:07 GMT+01:00 Andrea Gazzarini : > Do you mean "phrase" or "term" prefixes? If you try to put a field value > (two or more terms) in the analysis page you will see what the index > analyzer

Re: Solr Auto-Complete

2015-12-06 Thread Salman Ansari
That is right. I am actually looking for phrase prefixes not each term prefix within the phrase. That satisfies my requirements. However, my additional question was how do I manipulate the filedType to later allow for suffix matches as well? or will that be a completely different fieldType

Re: Solr Auto-Complete

2015-12-04 Thread Alexandre Rafalovitch
You can see an example of similar use at: http://www.solr-start.com/javadoc/solr-lucene/index.html (search box). The corresponding schema is here: https://github.com/arafalov/Solr-Javadoc/blob/master/JavadocIndex/JavadocCollection/conf/schema.xml#L24 . It does have some extra special-case stuff

Re: Solr Auto-Complete

2015-12-04 Thread Salman Ansari
Thanks Alan, Alessandaro and Andrea for your great explanations. I will follow the path of adding edge ngrams to the field type for my use case. Regards, Salman On Thu, Dec 3, 2015 at 12:23 PM, Alessandro Benedetti wrote: > "Sounds good but I heard "/suggest" component

Re: Solr Auto-Complete

2015-12-03 Thread Alessandro Benedetti
"Sounds good but I heard "/suggest" component is the recommended way of doing auto-complete" This sounds fantastic :) We "heard" that as well, we know what the suggest component does. The point is that you would like to retrieve the suggestions + some consistent payload in different fields.

Re: Solr Auto-Complete

2015-12-02 Thread Salman Ansari
Sounds good but I heard "/suggest" component is the recommended way of doing auto-complete in the new versions of Solr. Something along the lines of this article https://cwiki.apache.org/confluence/display/solr/Suggester mySuggester FuzzyLookupFactory DocumentDictionaryFactory

Re: Solr Auto-Complete

2015-12-02 Thread Andrea Gazzarini
Hi Salman, few months ago I have been involved in a project similar to map.geoadmin.ch and there, I had your same need (I also sent an email to this list). >From my side I can furtherly confirm what Alan and Alessandro already explained, I followed that approach. IMHO, that is the "recommended

Solr Auto-Complete

2015-12-02 Thread Salman Ansari
Hi, I am looking for auto-complete in Solr but on top of just auto complete I want as well to return the data completely (not just suggestions), so I want to get back the ids, and other fields in the whole document. I tried the following 2 approaches but each had issues 1) Used the /suggest

Re: Solr Auto-Complete

2015-12-02 Thread Alan Woodward
Hi Salman, It sounds as though you want to do a normal search against a special 'suggest' field, that's been indexed with edge ngrams. Alan Woodward www.flax.co.uk On 2 Dec 2015, at 09:31, Salman Ansari wrote: > Hi, > > I am looking for auto-complete in Solr but on top of just auto complete

Re: Solr Auto-Complete

2015-12-02 Thread Alessandro Benedetti
Hi Salman, I agree with Alan. Just configure your schema with the proper analysers . For the field you want to use for suggestions you are likely to need simply this fieldType : This is a