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 to allow to search by the fragments, but the general use case is the same. Regards, Alex. ---- Newsletter and resources for Solr beginners and intermediates: http://www.solr-start.com/ On 4 December 2015 at 10:11, Salman Ansari <salman.rah...@gmail.com> wrote: > 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 <abenede...@apache.org >> wrote: > >> "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. >> Current suggest component offers some effort in providing a payload, but >> almost all the suggester implementation are based on an FST approach which >> aim to be as fast and memory efficient as possible. >> Honestly you could experiment and even contribute a customisation if you >> want to add a new feature to the suggest component able to return complex >> payloads together with the suggestions. >> Apart that, it strictly depends of how you want to provide the >> autocompletion, there are plenty of different lookups implementation and >> plenty of tokenizer/token filters to combine . >> So I would confirm what we already said and that Andrea confirmed. >> >> If anyone has played with the suggester suggestions payload, his feedback >> is welcome! >> >> Cheers >> >> >> On 3 December 2015 at 06:21, Andrea Gazzarini <a.gazzar...@gmail.com> >> wrote: >> >> > 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 way" if the component's features meet your >> > needs (i.e. do not reinvent the wheel) but it seems you're out of those >> > bounds. >> > >> > Best, >> > Andrea >> > On 2 Dec 2015 21:51, "Salman Ansari" <salman.rah...@gmail.com> wrote: >> > >> > > 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 >> > > >> > > <searchComponent name="suggest" class="solr.SuggestComponent"> >> > > <lst name="suggester"> >> > > <str name="name">mySuggester</str> >> > > <str name="lookupImpl">FuzzyLookupFactory</str> >> > > <str name="dictionaryImpl">DocumentDictionaryFactory</str> >> > > <str name="field">cat</str> >> > > <str name="weightField">price</str> >> > > <str name="suggestAnalyzerFieldType">string</str> >> > > <str name="buildOnStartup">false</str> >> > > </lst> >> > > </searchComponent> >> > > >> > > Can someone confirm this? >> > > >> > > Regards, >> > > Salman >> > > >> > > >> > > On Wed, Dec 2, 2015 at 1:14 PM, Alessandro Benedetti < >> > > abenede...@apache.org> >> > > wrote: >> > > >> > > > 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 : >> > > > >> > > > <fieldType name="text_suggestion" class="solr.TextField" >> > > > positionIncrementGap="100"> >> > > > <analyzer type="index"> >> > > > <tokenizer class="solr.StandardTokenizerFactory"/> >> > > > <filter class="solr.LowerCaseFilterFactory"/> >> > > > <filter class="solr.EdgeNGramFilterFactory" >> minGramSize="1" >> > > > maxGramSize="20"/> >> > > > </analyzer> >> > > > <analyzer type="query"> >> > > > <tokenizer class="solr.StandardTokenizerFactory"/> >> > > > <filter class="solr.LowerCaseFilterFactory"/> >> > > > </analyzer> >> > > > </fieldType> >> > > > >> > > > This is a very sample example, please adapt it to your use case. >> > > > >> > > > Cheers >> > > > >> > > > On 2 December 2015 at 09:41, Alan Woodward <a...@flax.co.uk> wrote: >> > > > >> > > > > 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 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 component but that returns a very specific >> > > format >> > > > > > which looks like I cannot customize. I want to return the whole >> > > > document >> > > > > > that has a matching field and not only the suggestion list. So >> for >> > > > > example, >> > > > > > if I write "hard" it returns the results in a specific format as >> > > > follows >> > > > > > >> > > > > > <arr name="suggestion"> <str>hard drive</str> >> > > > > > <str>hard disk</str> </arr> >> > > > > > >> > > > > > Is there a way to get back additional fields with suggestions? >> > > > > > >> > > > > > 2) Tried the normal /select component but that does not do >> > > > auto-complete >> > > > > on >> > > > > > portion of the word. So, for example, if I write the query as >> > "bara" >> > > it >> > > > > > DOES NOT return "barack obama". Any suggestions how to solve >> this? >> > > > > > >> > > > > > >> > > > > > Regards, >> > > > > > Salman >> > > > > >> > > > > >> > > > >> > > > >> > > > -- >> > > > -------------------------- >> > > > >> > > > Benedetti Alessandro >> > > > Visiting card : http://about.me/alessandro_benedetti >> > > > >> > > > "Tyger, tyger burning bright >> > > > In the forests of the night, >> > > > What immortal hand or eye >> > > > Could frame thy fearful symmetry?" >> > > > >> > > > William Blake - Songs of Experience -1794 England >> > > > >> > > >> > >> >> >> >> -- >> -------------------------- >> >> Benedetti Alessandro >> Visiting card : http://about.me/alessandro_benedetti >> >> "Tyger, tyger burning bright >> In the forests of the night, >> What immortal hand or eye >> Could frame thy fearful symmetry?" >> >> William Blake - Songs of Experience -1794 England >>