You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Salonee Rege <sa...@usc.edu> on 2015/10/27 18:44:20 UTC

Using books.json in solr

Hello,
  We are trying to query the books.json that we have posted to solr. But
when we try to specfically query it on genre it does not return a complete
json with valid key-value pairs. Kindly help.

*Salonee Rege*
USC Viterbi School of Engineering
University of Southern California
Master of Computer Science - Student
Computer Science - B.E
saloneer@usc.edu  *||* *619-709-6756*

Re: Using books.json in solr

Posted by Sameer Maggon <sa...@measuredsearch.com>.
Hi Salonee, can you post the query and your schema file too?

Thanks,
-- 
*Sameer Maggon*
www.measuredsearch.com <http://measuredsearch.com/>
Solr Cloud Hosting | Managed Services | Solr Consulting


On Tue, Oct 27, 2015 at 10:44 AM, Salonee Rege <sa...@usc.edu> wrote:

> Hello,
>   We are trying to query the books.json that we have posted to solr. But
> when we try to specfically query it on genre it does not return a complete
> json with valid key-value pairs. Kindly help.
>
> *Salonee Rege*
> USC Viterbi School of Engineering
> University of Southern California
> Master of Computer Science - Student
> Computer Science - B.E
> saloneer@usc.edu  *||* *619-709-6756 <619-709-6756>*
>
>
>

Re: Using books.json in solr

Posted by Rallavagu <ra...@gmail.com>.
Could you simply paste the query from Solr logs here?

On 10/27/15 10:57 AM, Salonee Rege wrote:
> Please find attached the following books.json which is in the
> example-docs file for your reference. And a screenshot of querying it on
> the field fantasy for genre key.
> Thanks for the help.
>
>
> /Salonee Rege/
> USC Viterbi School of Engineering
> University of Southern California
> Master of Computer Science - Student
> Computer Science - B.E
> saloneer@usc.edu <ma...@usc.edu> _||_ _619-709-6756_
> _
> _
> _
> _
>
> On Tue, Oct 27, 2015 at 10:47 AM, Rallavagu <rallavagu@gmail.com
> <ma...@gmail.com>> wrote:
>
>     Could you please share your query? You could use "wt=json" query
>     parameter to receive JSON formatted results if that is what you are
>     looking for.
>
>     On 10/27/15 10:44 AM, Salonee Rege wrote:
>
>         Hello,
>             We are trying to query the books.json that we have posted to
>         solr.
>         But when we try to specfically query it on genre it does not
>         return a
>         complete json with valid key-value pairs. Kindly help.
>
>         /Salonee Rege/
>         USC Viterbi School of Engineering
>         University of Southern California
>         Master of Computer Science - Student
>         Computer Science - B.E
>         saloneer@usc.edu <ma...@usc.edu>
>         <mailto:saloneer@usc.edu <ma...@usc.edu>> _||_
>         _619-709-6756 <tel:619-709-6756>_
>         _
>         _
>         _
>         _
>
>

Re: Using books.json in solr

Posted by Salonee Rege <sa...@usc.edu>.
Thanks . We tried genre_s:fantasy and it worked. Thank you for the help. We
were stuck on this for a long time. Another question is that when we query
the value for the author Rick it returns the JSON without having to specify
author:Rick . Is there any specific reason for this? Will we have to do
this for all the fields query ?
 {
 "id" : "978-1423103349",
>     "cat" : ["book","paperback"],
>     "name" : "The Sea of Monsters",
>     "author" : "Rick Riordan",
>     "series_t" : "Percy Jackson and the Olympians",
>     "sequence_i" : 2,
>     "genre_s" : "fantasy",
>     "inStock" : true,
>     "price" : 6.49,
>     "pages_i" : 304
  }

Thanks and Regards ,
Salonee Rege

*Salonee Rege*
USC Viterbi School of Engineering
University of Southern California
Master of Computer Science - Student
Computer Science - B.E
saloneer@usc.edu  *||* *619-709-6756*



On Tue, Oct 27, 2015 at 11:40 AM, Erik Hatcher <er...@gmail.com>
wrote:

> Salonee - attachments generally do not pass through the solr-user list.
>
> If you added a field, did you then *reindex* the data?   And what was the
> query you gave?   Just q=fantasy may not be good enough (see debug=true
> output and what the query was parsed to, in particular what fields were
> queried).  Try q=genre_s:fantasy (after reindexing)
>
> —
> Erik Hatcher, Senior Solutions Architect
> http://www.lucidworks.com <http://www.lucidworks.com/>
>
>
>
>
> > On Oct 27, 2015, at 2:35 PM, Salonee Rege <sa...@usc.edu> wrote:
> >
> >  {
> >     "id" : "978-1423103349",
> >     "cat" : ["book","paperback"],
> >     "name" : "The Sea of Monsters",
> >     "author" : "Rick Riordan",
> >     "series_t" : "Percy Jackson and the Olympians",
> >     "sequence_i" : 2,
> >     "genre_s" : "fantasy",
> >     "inStock" : true,
> >     "price" : 6.49,
> >     "pages_i" : 304
> >   }
> >
> > We have uploaded the books.json from exampledocs in the example folder
> of solr. In schema.xml we have included the following field:
> > <field name="genre_s" type="string" indexed="true" stored="true"/>
> >
> > But when we try to query the JSON on genre field by querying "fantasy"
> we get the following result. PFA the screenshot of our result.
> >
> > Salonee Rege
> > USC Viterbi School of Engineering
> > University of Southern California
> > Master of Computer Science - Student
> > Computer Science - B.E
> > saloneer@usc.edu <ma...@usc.edu>  || 619-709-6756
> >
> >
> >
> > On Tue, Oct 27, 2015 at 11:22 AM, Salonee Rege <saloneer@usc.edu
> <ma...@usc.edu>> wrote:
> > Hello
> >
> > Salonee Rege
> > USC Viterbi School of Engineering
> > University of Southern California
> > Master of Computer Science - Student
> > Computer Science - B.E
> > saloneer@usc.edu <ma...@usc.edu>  || 619-709-6756 <tel:
> 619-709-6756>
> >
> >
> >
> > On Tue, Oct 27, 2015 at 11:06 AM, Sameer Maggon <
> sameer@measuredsearch.com <ma...@measuredsearch.com>> wrote:
> > Hi Salonee,
> >
> > I believe you missed adding the query screenshot?
> >
> > Sameer.
> >
> > On Tue, Oct 27, 2015 at 10:57 AM, Salonee Rege <saloneer@usc.edu
> <ma...@usc.edu>> wrote:
> >
> > > Please find attached the following books.json which is in the
> example-docs
> > > file for your reference. And a screenshot of querying it on the field
> > > fantasy for genre key.
> > > Thanks for the help.
> > >
> > >
> > > *Salonee Rege*
> > > USC Viterbi School of Engineering
> > > University of Southern California
> > > Master of Computer Science - Student
> > > Computer Science - B.E
> > > saloneer@usc.edu <ma...@usc.edu>  *||* *619-709-6756 <tel:
> 619-709-6756> <619-709-6756 <tel:619-709-6756>>*
> > >
> > >
> > >
> > > On Tue, Oct 27, 2015 at 10:47 AM, Rallavagu <rallavagu@gmail.com
> <ma...@gmail.com>> wrote:
> > >
> > >> Could you please share your query? You could use "wt=json" query
> > >> parameter to receive JSON formatted results if that is what you are
> looking
> > >> for.
> > >>
> > >> On 10/27/15 10:44 AM, Salonee Rege wrote:
> > >>
> > >>> Hello,
> > >>>    We are trying to query the books.json that we have posted to solr.
> > >>> But when we try to specfically query it on genre it does not return a
> > >>> complete json with valid key-value pairs. Kindly help.
> > >>>
> > >>> /Salonee Rege/
> > >>> USC Viterbi School of Engineering
> > >>> University of Southern California
> > >>> Master of Computer Science - Student
> > >>> Computer Science - B.E
> > >>> saloneer@usc.edu <ma...@usc.edu> <mailto:saloneer@usc.edu
> <ma...@usc.edu>> _||_ _619-709-6756 <tel:619-709-6756>_
> > >>> _
> > >>> _
> > >>> _
> > >>> _
> > >>>
> > >>
> > >
> >
> >
> > --
> > *Sameer Maggon*
> > Measured Search
> > c: 310.344.7266 <tel:310.344.7266>
> > www.measuredsearch.com <http://www.measuredsearch.com/> <
> http://measuredsearch.com <http://measuredsearch.com/>>
> >
> >
>
>

Re: Using books.json in solr

Posted by Erik Hatcher <er...@gmail.com>.
Salonee - attachments generally do not pass through the solr-user list.

If you added a field, did you then *reindex* the data?   And what was the query you gave?   Just q=fantasy may not be good enough (see debug=true output and what the query was parsed to, in particular what fields were queried).  Try q=genre_s:fantasy (after reindexing)

—
Erik Hatcher, Senior Solutions Architect
http://www.lucidworks.com <http://www.lucidworks.com/>




> On Oct 27, 2015, at 2:35 PM, Salonee Rege <sa...@usc.edu> wrote:
> 
>  {
>     "id" : "978-1423103349",
>     "cat" : ["book","paperback"],
>     "name" : "The Sea of Monsters",
>     "author" : "Rick Riordan",
>     "series_t" : "Percy Jackson and the Olympians",
>     "sequence_i" : 2,
>     "genre_s" : "fantasy",
>     "inStock" : true,
>     "price" : 6.49,
>     "pages_i" : 304
>   }
> 
> We have uploaded the books.json from exampledocs in the example folder of solr. In schema.xml we have included the following field:
> <field name="genre_s" type="string" indexed="true" stored="true"/>
> 
> But when we try to query the JSON on genre field by querying "fantasy" we get the following result. PFA the screenshot of our result.
> 
> Salonee Rege
> USC Viterbi School of Engineering
> University of Southern California
> Master of Computer Science - Student
> Computer Science - B.E
> saloneer@usc.edu <ma...@usc.edu>  || 619-709-6756
> 
> 
> 
> On Tue, Oct 27, 2015 at 11:22 AM, Salonee Rege <saloneer@usc.edu <ma...@usc.edu>> wrote:
> Hello
> 
> Salonee Rege
> USC Viterbi School of Engineering
> University of Southern California
> Master of Computer Science - Student
> Computer Science - B.E
> saloneer@usc.edu <ma...@usc.edu>  || 619-709-6756 <tel:619-709-6756>
> 
> 
> 
> On Tue, Oct 27, 2015 at 11:06 AM, Sameer Maggon <sameer@measuredsearch.com <ma...@measuredsearch.com>> wrote:
> Hi Salonee,
> 
> I believe you missed adding the query screenshot?
> 
> Sameer.
> 
> On Tue, Oct 27, 2015 at 10:57 AM, Salonee Rege <saloneer@usc.edu <ma...@usc.edu>> wrote:
> 
> > Please find attached the following books.json which is in the example-docs
> > file for your reference. And a screenshot of querying it on the field
> > fantasy for genre key.
> > Thanks for the help.
> >
> >
> > *Salonee Rege*
> > USC Viterbi School of Engineering
> > University of Southern California
> > Master of Computer Science - Student
> > Computer Science - B.E
> > saloneer@usc.edu <ma...@usc.edu>  *||* *619-709-6756 <tel:619-709-6756> <619-709-6756 <tel:619-709-6756>>*
> >
> >
> >
> > On Tue, Oct 27, 2015 at 10:47 AM, Rallavagu <rallavagu@gmail.com <ma...@gmail.com>> wrote:
> >
> >> Could you please share your query? You could use "wt=json" query
> >> parameter to receive JSON formatted results if that is what you are looking
> >> for.
> >>
> >> On 10/27/15 10:44 AM, Salonee Rege wrote:
> >>
> >>> Hello,
> >>>    We are trying to query the books.json that we have posted to solr.
> >>> But when we try to specfically query it on genre it does not return a
> >>> complete json with valid key-value pairs. Kindly help.
> >>>
> >>> /Salonee Rege/
> >>> USC Viterbi School of Engineering
> >>> University of Southern California
> >>> Master of Computer Science - Student
> >>> Computer Science - B.E
> >>> saloneer@usc.edu <ma...@usc.edu> <mailto:saloneer@usc.edu <ma...@usc.edu>> _||_ _619-709-6756 <tel:619-709-6756>_
> >>> _
> >>> _
> >>> _
> >>> _
> >>>
> >>
> >
> 
> 
> --
> *Sameer Maggon*
> Measured Search
> c: 310.344.7266 <tel:310.344.7266>
> www.measuredsearch.com <http://www.measuredsearch.com/> <http://measuredsearch.com <http://measuredsearch.com/>>
> 
> 


Re: Using books.json in solr

Posted by Salonee Rege <sa...@usc.edu>.
 {
    "id" : "978-1423103349",
    "cat" : ["book","paperback"],
    "name" : "The Sea of Monsters",
    "author" : "Rick Riordan",
    "series_t" : "Percy Jackson and the Olympians",
    "sequence_i" : 2,
    "genre_s" : "fantasy",
    "inStock" : true,
    "price" : 6.49,
    "pages_i" : 304
  }

We have uploaded the books.json from exampledocs in the example folder of
solr. In schema.xml we have included the following field:
<field name="genre_s" type="string" indexed="true" stored="true"/>

But when we try to query the JSON on genre field by querying "fantasy" we
get the following result. PFA the screenshot of our result.

*Salonee Rege*
USC Viterbi School of Engineering
University of Southern California
Master of Computer Science - Student
Computer Science - B.E
saloneer@usc.edu  *||* *619-709-6756*



On Tue, Oct 27, 2015 at 11:22 AM, Salonee Rege <sa...@usc.edu> wrote:

> Hello
>
> *Salonee Rege*
> USC Viterbi School of Engineering
> University of Southern California
> Master of Computer Science - Student
> Computer Science - B.E
> saloneer@usc.edu  *||* *619-709-6756 <619-709-6756>*
>
>
>
> On Tue, Oct 27, 2015 at 11:06 AM, Sameer Maggon <sameer@measuredsearch.com
> > wrote:
>
>> Hi Salonee,
>>
>> I believe you missed adding the query screenshot?
>>
>> Sameer.
>>
>> On Tue, Oct 27, 2015 at 10:57 AM, Salonee Rege <sa...@usc.edu> wrote:
>>
>> > Please find attached the following books.json which is in the
>> example-docs
>> > file for your reference. And a screenshot of querying it on the field
>> > fantasy for genre key.
>> > Thanks for the help.
>> >
>> >
>> > *Salonee Rege*
>> > USC Viterbi School of Engineering
>> > University of Southern California
>> > Master of Computer Science - Student
>> > Computer Science - B.E
>> > saloneer@usc.edu  *||* *619-709-6756 <619-709-6756>*
>> >
>> >
>> >
>> > On Tue, Oct 27, 2015 at 10:47 AM, Rallavagu <ra...@gmail.com>
>> wrote:
>> >
>> >> Could you please share your query? You could use "wt=json" query
>> >> parameter to receive JSON formatted results if that is what you are
>> looking
>> >> for.
>> >>
>> >> On 10/27/15 10:44 AM, Salonee Rege wrote:
>> >>
>> >>> Hello,
>> >>>    We are trying to query the books.json that we have posted to solr.
>> >>> But when we try to specfically query it on genre it does not return a
>> >>> complete json with valid key-value pairs. Kindly help.
>> >>>
>> >>> /Salonee Rege/
>> >>> USC Viterbi School of Engineering
>> >>> University of Southern California
>> >>> Master of Computer Science - Student
>> >>> Computer Science - B.E
>> >>> saloneer@usc.edu <ma...@usc.edu> _||_ _619-709-6756_
>> >>> _
>> >>> _
>> >>> _
>> >>> _
>> >>>
>> >>
>> >
>>
>>
>> --
>> *Sameer Maggon*
>> Measured Search
>> c: 310.344.7266
>> www.measuredsearch.com <http://measuredsearch.com>
>>
>
>

Re: Using books.json in solr

Posted by Salonee Rege <sa...@usc.edu>.
Hello

*Salonee Rege*
USC Viterbi School of Engineering
University of Southern California
Master of Computer Science - Student
Computer Science - B.E
saloneer@usc.edu  *||* *619-709-6756*



On Tue, Oct 27, 2015 at 11:06 AM, Sameer Maggon <sa...@measuredsearch.com>
wrote:

> Hi Salonee,
>
> I believe you missed adding the query screenshot?
>
> Sameer.
>
> On Tue, Oct 27, 2015 at 10:57 AM, Salonee Rege <sa...@usc.edu> wrote:
>
> > Please find attached the following books.json which is in the
> example-docs
> > file for your reference. And a screenshot of querying it on the field
> > fantasy for genre key.
> > Thanks for the help.
> >
> >
> > *Salonee Rege*
> > USC Viterbi School of Engineering
> > University of Southern California
> > Master of Computer Science - Student
> > Computer Science - B.E
> > saloneer@usc.edu  *||* *619-709-6756 <619-709-6756>*
> >
> >
> >
> > On Tue, Oct 27, 2015 at 10:47 AM, Rallavagu <ra...@gmail.com> wrote:
> >
> >> Could you please share your query? You could use "wt=json" query
> >> parameter to receive JSON formatted results if that is what you are
> looking
> >> for.
> >>
> >> On 10/27/15 10:44 AM, Salonee Rege wrote:
> >>
> >>> Hello,
> >>>    We are trying to query the books.json that we have posted to solr.
> >>> But when we try to specfically query it on genre it does not return a
> >>> complete json with valid key-value pairs. Kindly help.
> >>>
> >>> /Salonee Rege/
> >>> USC Viterbi School of Engineering
> >>> University of Southern California
> >>> Master of Computer Science - Student
> >>> Computer Science - B.E
> >>> saloneer@usc.edu <ma...@usc.edu> _||_ _619-709-6756_
> >>> _
> >>> _
> >>> _
> >>> _
> >>>
> >>
> >
>
>
> --
> *Sameer Maggon*
> Measured Search
> c: 310.344.7266
> www.measuredsearch.com <http://measuredsearch.com>
>

Re: Using books.json in solr

Posted by Sameer Maggon <sa...@measuredsearch.com>.
Hi Salonee,

I believe you missed adding the query screenshot?

Sameer.

On Tue, Oct 27, 2015 at 10:57 AM, Salonee Rege <sa...@usc.edu> wrote:

> Please find attached the following books.json which is in the example-docs
> file for your reference. And a screenshot of querying it on the field
> fantasy for genre key.
> Thanks for the help.
>
>
> *Salonee Rege*
> USC Viterbi School of Engineering
> University of Southern California
> Master of Computer Science - Student
> Computer Science - B.E
> saloneer@usc.edu  *||* *619-709-6756 <619-709-6756>*
>
>
>
> On Tue, Oct 27, 2015 at 10:47 AM, Rallavagu <ra...@gmail.com> wrote:
>
>> Could you please share your query? You could use "wt=json" query
>> parameter to receive JSON formatted results if that is what you are looking
>> for.
>>
>> On 10/27/15 10:44 AM, Salonee Rege wrote:
>>
>>> Hello,
>>>    We are trying to query the books.json that we have posted to solr.
>>> But when we try to specfically query it on genre it does not return a
>>> complete json with valid key-value pairs. Kindly help.
>>>
>>> /Salonee Rege/
>>> USC Viterbi School of Engineering
>>> University of Southern California
>>> Master of Computer Science - Student
>>> Computer Science - B.E
>>> saloneer@usc.edu <ma...@usc.edu> _||_ _619-709-6756_
>>> _
>>> _
>>> _
>>> _
>>>
>>
>


-- 
*Sameer Maggon*
Measured Search
c: 310.344.7266
www.measuredsearch.com <http://measuredsearch.com>

Re: Using books.json in solr

Posted by Salonee Rege <sa...@usc.edu>.
Please find attached the following books.json which is in the example-docs
file for your reference. And a screenshot of querying it on the field
fantasy for genre key.
Thanks for the help.


*Salonee Rege*
USC Viterbi School of Engineering
University of Southern California
Master of Computer Science - Student
Computer Science - B.E
saloneer@usc.edu  *||* *619-709-6756*



On Tue, Oct 27, 2015 at 10:47 AM, Rallavagu <ra...@gmail.com> wrote:

> Could you please share your query? You could use "wt=json" query parameter
> to receive JSON formatted results if that is what you are looking for.
>
> On 10/27/15 10:44 AM, Salonee Rege wrote:
>
>> Hello,
>>    We are trying to query the books.json that we have posted to solr.
>> But when we try to specfically query it on genre it does not return a
>> complete json with valid key-value pairs. Kindly help.
>>
>> /Salonee Rege/
>> USC Viterbi School of Engineering
>> University of Southern California
>> Master of Computer Science - Student
>> Computer Science - B.E
>> saloneer@usc.edu <ma...@usc.edu> _||_ _619-709-6756_
>> _
>> _
>> _
>> _
>>
>

Re: Using books.json in solr

Posted by Rallavagu <ra...@gmail.com>.
Could you please share your query? You could use "wt=json" query 
parameter to receive JSON formatted results if that is what you are 
looking for.

On 10/27/15 10:44 AM, Salonee Rege wrote:
> Hello,
>    We are trying to query the books.json that we have posted to solr.
> But when we try to specfically query it on genre it does not return a
> complete json with valid key-value pairs. Kindly help.
>
> /Salonee Rege/
> USC Viterbi School of Engineering
> University of Southern California
> Master of Computer Science - Student
> Computer Science - B.E
> saloneer@usc.edu <ma...@usc.edu> _||_ _619-709-6756_
> _
> _
> _
> _