Highlighting on typing in search box

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Highlighting on typing in search box

rhys J
Are there any recommended APIs or code examples of using Solr and then
highlighting results below the search box?

I'm trying to implement a search box that will search solr as the user
types, if that makes sense?

Thanks,

Rhys
Reply | Threaded
Open this post in threaded view
|

Re: Highlighting on typing in search box

David Hastings
you can modify the result in this SO question to fit your needs:

https://stackoverflow.com/questions/16742610/retrieve-results-from-solr-using-jquery-calls

On Thu, Nov 21, 2019 at 10:42 AM rhys J <[hidden email]> wrote:

> Are there any recommended APIs or code examples of using Solr and then
> highlighting results below the search box?
>
> I'm trying to implement a search box that will search solr as the user
> types, if that makes sense?
>
> Thanks,
>
> Rhys
>
Reply | Threaded
Open this post in threaded view
|

Re: Highlighting on typing in search box

Jörn Franke
In reply to this post by rhys J
It sounds like you look for a suggester.

You can use the suggester of Solr.

For the visualization part: Angular has a suggestion box that can ingest the results from Solr.

> Am 21.11.2019 um 16:42 schrieb rhys J <[hidden email]>:
>
> Are there any recommended APIs or code examples of using Solr and then
> highlighting results below the search box?
>
> I'm trying to implement a search box that will search solr as the user
> types, if that makes sense?
>
> Thanks,
>
> Rhys
Reply | Threaded
Open this post in threaded view
|

Re: Highlighting on typing in search box

rhys J
Thank you both! I've got an autocomplete working on a basic format right
now, and I'm working on implementing it to be smart about which core it
searches.

On Thu, Nov 21, 2019 at 11:43 AM Jörn Franke <[hidden email]> wrote:

> It sounds like you look for a suggester.
>
> You can use the suggester of Solr.
>
> For the visualization part: Angular has a suggestion box that can ingest
> the results from Solr.
>
> > Am 21.11.2019 um 16:42 schrieb rhys J <[hidden email]>:
> >
> > Are there any recommended APIs or code examples of using Solr and then
> > highlighting results below the search box?
> >
> > I'm trying to implement a search box that will search solr as the user
> > types, if that makes sense?
> >
> > Thanks,
> >
> > Rhys
>
Reply | Threaded
Open this post in threaded view
|

Re: Highlighting on typing in search box

Paras Lehana
Hi rhys,

You are actually looking for an autocomplete! I work for the Auto-Suggest
(different names for the same thing) team at Indiamart.

Although we have a long journey making our Auto-Suggest one of the fastest
on the internet, I hope this summary will help you. You can always
connect with me for any doubt.

   1. If you don't have a high number of documents, you can use wildcards
   in the query for a simpler implementation. That means, you just convert
   your query from q=app to q=app* so that it matches "apple". Wildcards have
   its own cons (constant scoring, high QTime) and since it's a multi-term
   expansion, you cannot use many analyzers over the query. It had been
   performing well (under 50 ms QTime) till we had 22 million documents (which
   is still a large number of documents).

   2. Now that we have over 60 million documents, we have shifted to Edge
   NGrams
   <https://lucene.apache.org/solr/guide/8_3/tokenizers.html#edge-n-gram-tokenizer>
   on the index side. Using this, your highlighting should work as expected
   and as you do in normal searching.

   3. You also have Suggester
   <https://lucene.apache.org/solr/guide/8_3/suggester.html> component for
   Solr that you can use for basic suggester functionalities. Supports
   highlighting.


From my experience, the best solution is Edge NGrams (2). We have over 60
million documents and still a 25 ms QTime and we do complex scoring and
analysis.

On Thu, 21 Nov 2019 at 22:43, rhys J <[hidden email]> wrote:

> Thank you both! I've got an autocomplete working on a basic format right
> now, and I'm working on implementing it to be smart about which core it
> searches.
>
> On Thu, Nov 21, 2019 at 11:43 AM Jörn Franke <[hidden email]> wrote:
>
> > It sounds like you look for a suggester.
> >
> > You can use the suggester of Solr.
> >
> > For the visualization part: Angular has a suggestion box that can ingest
> > the results from Solr.
> >
> > > Am 21.11.2019 um 16:42 schrieb rhys J <[hidden email]>:
> > >
> > > Are there any recommended APIs or code examples of using Solr and then
> > > highlighting results below the search box?
> > >
> > > I'm trying to implement a search box that will search solr as the user
> > > types, if that makes sense?
> > >
> > > Thanks,
> > >
> > > Rhys
> >
>


--
--
Regards,

*Paras Lehana* [65871]
Development Engineer, Auto-Suggest,
IndiaMART Intermesh Ltd.

8th Floor, Tower A, Advant-Navis Business Park, Sector 142,
Noida, UP, IN - 201303

Mob.: +91-9560911996
Work: 01203916600 | Extn:  *8173*

--
IMPORTANT: 
NEVER share your IndiaMART OTP/ Password with anyone.