Parameter Mapping

2018-07-29 Thread Renuka Srishti
Hi,

I was reading the document and I think parameters mapping

mentioned here is not right.
start, rows are used for query parameters.
offset, limit are used for JSON query format.

Should I create the ticket for it?

Thanks
Renuka Srishti


Re: Parameter Mapping

2018-07-29 Thread Alexandre Rafalovitch
You are right. Yes please, create a ticket for it. If you can do a
patch against the trunk (version 8), it is even better. You can do it
directly on Github if doing git checkout is hard. Just make sure to
reference the relevant Jira ticket.

Thank you,
Alex.

On 29 July 2018 at 08:39, Renuka Srishti  wrote:
> Hi,
>
> I was reading the document and I think parameters mapping
> 
> mentioned here is not right.
> start, rows are used for query parameters.
> offset, limit are used for JSON query format.
>
> Should I create the ticket for it?
>
> Thanks
> Renuka Srishti


Search without passing any field

2018-07-29 Thread Renuka Srishti
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


Re: Search without passing any field

2018-07-29 Thread Alexandre Rafalovitch
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  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


Re: Search without passing any field

2018-07-29 Thread Erick Erickson
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
 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  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


Re: Search without passing any field

2018-07-29 Thread Renuka Srishti
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 
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
>  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 
> 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
>


Re: Search without passing any field

2018-07-29 Thread Alexandre Rafalovitch
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  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 
> 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
>>  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 
>> 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
>>


Re: Search without passing any field

2018-07-29 Thread Renuka Srishti
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 
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 
> 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  >
> > 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
> >>  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 
> >> 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
> >>
>


Re: Search without passing any field

2018-07-29 Thread Alexandre Rafalovitch
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  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 
> 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 
>> 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 > >
>> > 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
>> >>  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 
>> >> 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
>> >>
>>


Re: Search without passing any field

2018-07-29 Thread Renuka Srishti
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 
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 
> 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 
> >> 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
> >> >>  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
> >> >> >

Re: Search without passing any field

2018-07-29 Thread Walter Underwood
No, it won’t slow down performance, but it might use more disk space for the 
index.

Searching one field is usually faster than searching multiple fields. If it was 
a lot slower,
the tutorial would have warned about that.

How large is your index? There are some very large Solr collections. Ours is 26 
million
docs and it isn’t close to the biggest.

wunder
Walter Underwood
wun...@wunderwood.org
http://observer.wunderwood.org/  (my blog)

> On Jul 29, 2018, at 11:15 AM, Renuka Srishti  
> 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 
> 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 
>> 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 >> 
>>> 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
  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 
 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
 
>> 



Re: Search without passing any field

2018-07-29 Thread Renuka Srishti
Okay, great. I will start with the available solution . My index is less
than yours, so may be it will work.

Thanks
Renuka Srishti

On Mon, Jul 30, 2018 at 12:04 AM, Walter Underwood 
wrote:

> No, it won’t slow down performance, but it might use more disk space for
> the index.
>
> Searching one field is usually faster than searching multiple fields. If
> it was a lot slower,
> the tutorial would have warned about that.
>
> How large is your index? There are some very large Solr collections. Ours
> is 26 million
> docs and it isn’t close to the biggest.
>
> wunder
> Walter Underwood
> wun...@wunderwood.org
> http://observer.wunderwood.org/  (my blog)
>
> > On Jul 29, 2018, at 11:15 AM, Renuka Srishti 
> 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 
> >> 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
>   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  >
>  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
> 
> >>
>
>


Re: Can the export handler be used with the edismax or dismax query handler

2018-07-29 Thread Tom Burton-West
Thanks Mikhail and Erick,

I don't need ranks or score.  I just need the full set of results.  Will
the export handler work with a fq that uses edismax? (I'm not at work
today, but I can try it out tomorrow.)

I compared a simple (not edismax) query and the export handler with
cursormark with rows = 50K to 200K.  The export handler took about 8 ms to
export all 1.9 million results and had minimal impact on server CPU and
memory.  With the cursormark it took about 1 minute 20 seconds, CPU use
increased by about 25% and there were many more garbage collections
although the time for GC totaled only a few seconds.

Tom



On Sat, Jul 28, 2018 at 4:25 AM, Mikhail Khludnev  wrote:

> Tom,
> Do you say you don't need rank results or you don't need to export score?
> If the former is true, you can just put edismax to fq.
> Just a note: using cursor mark with the score may cause some kind of hit
> dupes and probably missing some ones.
>
> On Sat, Jul 28, 2018 at 5:20 AM Erick Erickson 
> wrote:
>
> > What about cursorMark? That's designed to handle repeated calls with
> > increasing "start" parameters without bogging down.
> >
> > https://lucene.apache.org/solr/guide/6_6/pagination-of-results.html
> >
> > Best,
> > Erick
> >
> > On Fri, Jul 27, 2018 at 9:47 AM, Tom Burton-West 
> > wrote:
> > > Thanks Joel,
> > >
> > > My use case is that I have a complex edismax query (example below)  and
> > the
> > > user wants to download the set of *all* search results (ids and some
> > small
> > > metadata fields).   So they don't need the relevance ranking.
> However, I
> > > need to somehow get the exact set that the complex edismax query
> matched.
> > >
> > > Should I try to write some code to rewrite  the logic of the edismax
> > query
> > > with a complex boolean query or would it make sense for me to look at
> > > possibly modifying the export handler for my use case?
> > >
> > > Tom
> > >
> > > "q= _query_:"{!edismax
> > >
> > qf='ocr^5+allfieldsProper^2+allfields^1+titleProper^50+
> title_topProper^30+title_restProper^15+title^10+title_
> top^5+title_rest^2+series^5+series2^5+author^80+author2^
> 50+issn^1+isbn^1+oclc^1+sdrnum^1+ctrlnum^1+id^1+
> rptnum^1+topicProper^2+topic^1+hlb3^1+fullgeographic^1+fullgenre^1+era^1+'
> > >
> > pf='title_ab^1+titleProper^1500+title_topProper^1000+title_
> restProper^800+series^100+series2^100+author^1600+
> author2^800+topicProper^200+fullgenre^200+hlb3^200+allfieldsProper^100+'
> > > mm='100%25' tie='0.9' } European Art History"
> > >
> > >
> > > On Thu, Jul 26, 2018 at 6:02 PM, Joel Bernstein 
> > wrote:
> > >
> > >> The export handler doesn't allow sorting by score at this time. It
> only
> > >> supports sorting on fields. So the edismax qparser won't cxcurrently
> > work
> > >> with the export handler.
> > >>
> > >> Joel Bernstein
> > >> http://joelsolr.blogspot.com/
> > >>
> > >> On Thu, Jul 26, 2018 at 5:52 PM, Tom Burton-West 
> > >> wrote:
> > >>
> > >> > Hello all,
> > >> >
> > >> > I am completely new to the export handler.
> > >> >
> > >> > Can the export handler be used with the edismax or dismax query
> > handler?
> > >> >
> > >> > I tried using local params :
> > >> >
> > >> > q= _query_:"{!edismax qf='ocr^5+allfields^1+titleProper^50'
> > >> > mm='100%25'
> > >> > tie='0.9' } art"
> > >> >
> > >> > which does not seem to be working.
> > >> >
> > >> > Tom
> > >> >
> > >>
> >
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>


Cannot train 2 or more features for Solr LTR using LIBLINEAR

2018-07-29 Thread Zheng Lin Edwin Yeo
Hi,

I am using the Solr LTR in Solr 7.4.0, and I am trying to train an example
learning model using LIBLINEAR.

When I tried to run the code from train_and_upload_demo_model.py , I can
only train one feature at a time. If I put more than one features, then I
will get the following error

Traceback (most recent call last):

  File "train_and_upload_demo_model.py", line 182, in 

sys.exit(main())

  File "train_and_upload_demo_model.py", line 169, in main


formatter.processQueryDocFeatureVector(fvGenerator,config["trainingFile"]);

  File
"/cygdrive/c/Users/edwin_000/Desktop/edwin/edm-7.4.0/contrib/ltr/myModel/libsvm_formatter.py",
line 25, in processQueryDocFeatureVector

curListOfFv.append((relevance,self._makeFeaturesMap(featureVector)))

  File
"/cygdrive/c/Users/edwin_000/Desktop/edwin/edm-7.4.0/contrib/ltr/myModel/libsvm_formatter.py",
line 35, in _makeFeaturesMap

featName,featValue = keyValuePairStr.split(":");

ValueError: too many values to unpack


Is there any way that we can do so that we can train 2 or more features at
the same time?

Regards,
Edwin