Thanks I got it. Somehow I have to tell about fields to solr, it can't
automatically apply search on all indexed fields.


On Sun, Jul 29, 2018 at 11:54 PM, Alexandre Rafalovitch <arafa...@gmail.com>
wrote:

> You may be doing premature optimization here.
>
> Remember the copyTarget is store=false/docValues=false, so you are
> only actually storing unique tokens and document ids/offsets. I would
> recommend you start from that, do your first schema, figure out what
> you are not happy about, evolve it, etc.
>
> However, you can also switch to eDismax and name specific fields you
> want to search with qf parameter.
> https://lucene.apache.org/solr/guide/7_4/the-extended-
> dismax-query-parser.html
> (extension of base query parser).
>
> Just remember that the processing of the field depends on the field
> type. So, with copyField, you were searching everything by that type
> (probably text). With eDismax, if your field is string, you have to
> match it exactly. Unless you copyField and process it twice. And so
> on. You have a lot of options, depending on your use cases.
>
> Good luck,
>    Alex.
>
> On 29 July 2018 at 14:15, Renuka Srishti <renuka.srisht...@gmail.com>
> wrote:
> > Yeah, I read that, but it will slow down the performance, as copying all
> > the fields and put that data in one field. I think for large index it is
> > not the right way to do. Am I right?
> >
> > Regards,
> > Renuka Srishti
> >
> > On Sun, Jul 29, 2018 at 11:39 PM, Alexandre Rafalovitch <
> arafa...@gmail.com>
> > wrote:
> >
> >> Did you go through the tutorial in the Reference Guide?
> >>
> >> it explains a lot of these and has configuration for you to check. See
> >> for example (in a middle of tutorial):
> >> https://lucene.apache.org/solr/guide/7_4/solr-tutorial.
> >> html#create-a-catchall-copy-field
> >>
> >> Regards,
> >>    Alex.
> >>
> >> On 29 July 2018 at 13:45, Renuka Srishti <renuka.srisht...@gmail.com>
> >> wrote:
> >> > Thanks for response,
> >> >
> >> > Let me explain with an example.
> >> > I have following fields : name, description, id, title.
> >> > These fields have following values:
> >> > doc1 -
> >> > name : test
> >> > description : test and run
> >> > id : t1
> >> > title : abc title
> >> >
> >> > doc2 -
> >> > name : abc
> >> > description : test and run again
> >> > id : t2
> >> > title : xyz title
> >> >
> >> > You can see name and description both contain "test", so my question
> is
> >> if
> >> > I will query for "test" using "q" parameter without specifying the
> fields
> >> > in either "df" or "qf", will it be able to search? Because I tried,
> and I
> >> > think you have to mention the fields otherwise it will not work.
> >> > If I will put "df" and "qf" value as "name", so it will return only
> doc1,
> >> > but I want to return both documents when I query "test" (Because
> >> > description also contains "test"). Will it be possible without
> >> configuring
> >> > the "df" or "qf"? Is there any way to apply search on all fields?
> >> >
> >> > Thanks
> >> > Renuka Srishti
> >> >
> >> > On Sun, Jul 29, 2018 at 8:12 PM, Erick Erickson <
> erickerick...@gmail.com
> >> >
> >> > wrote:
> >> >
> >> >> What do you want Solr to do in that case? Search all the defined
> >> >> fields? Some of them? Pick randomly?
> >> >>
> >> >> This is like asking "can Solr do what I want without telling it what
> I
> >> >> want?".
> >> >>
> >> >> You can define df or qf _defaults_ in solrconfig.xml for the request
> >> >> handler, that's what those are for.
> >> >> Then the _user_ doesn't need to specify them. Somebody has to however
> >> >> and defaults are how those
> >> >> are usually done.
> >> >>
> >> >> Best,
> >> >> Erick
> >> >>
> >> >> On Sun, Jul 29, 2018 at 7:07 AM, Alexandre Rafalovitch
> >> >> <arafa...@gmail.com> wrote:
> >> >> > Solr does need to know what field(s) you want to search. And you
> can
> >> >> > configure all of these things in solrconfig.xml, so the user does
> not
> >> >> > have to provide that.
> >> >> >
> >> >> > Just remember, unless you really know what you are doing, you
> should
> >> >> > not be exposing Solr directly to the user/browser. Think of it more
> >> >> > like a database with another layer between it and user-queries.
> >> >> > Otherwise, somebody could delete your whole index, etc.
> >> >> >
> >> >> > Regards,
> >> >> >    Alex.
> >> >> >
> >> >> > On 29 July 2018 at 09:11, Renuka Srishti <
> renuka.srisht...@gmail.com>
> >> >> wrote:
> >> >> >> Hi,
> >> >> >>
> >> >> >> Is there any possible way to perform search by using "q" or
> "query"
> >> >> >> parameter without setting "df" parameter or "qf" parameter.
> >> >> >>
> >> >> >> for example: I am passing "q":"xyz"
> >> >> >> I have to mention the field for which I want to perform query
> >> otherwise
> >> >> I
> >> >> >> will not get results.
> >> >> >>
> >> >> >> What is the way if I want to search on all documents without
> >> mentioning
> >> >> any
> >> >> >> field.
> >> >> >> for example : I am passing "q":"xyz"
> >> >> >> If I query like that, it should return all the documents
> containing
> >> that
> >> >> >> value. No need to mention the fields.
> >> >> >>
> >> >> >> Thanks
> >> >> >> Renuka Srishti
> >> >>
> >>
>

Reply via email to