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 Jake Conk <ja...@gmail.com> on 2008/08/14 23:43:04 UTC

Simple Searching Question

Hello,

I inserted the following documents into Solr:

-------------------------------------------------------------------------------------------

<add>
<doc>
 <field name="id">124</field>
 <field name="foobar_facet">Jake Conk</field>
</doc>
<doc>
 <field name="id">125</field>
 <field name="foobar_facet">Jake Conk</field>
</doc>
</add>

-------------------------------------------------------------------------------------------

id is the only required integer field.
foobar_facet is a dynamic string field.

When I try to search for anything with the word Jake in it the
following ways I get no results.


select?q=Jake
select?q=Jake*


I thought one of those two should work but the only way I got it to
work was by specifying which field "Jake" is in along with a wild
card.


select?q=foobar_facet:Jake*


1) Does this mean for each field I would like to search if Jake exists
I would have to add each field like I did above to the query?

2) How would I search if I want to find the name Jake anywhere in the
string? The documentation
(http://lucene.apache.org/java/docs/queryparsersyntax.html) states
that I cannot use a wildcard as the first character such as *Jake*

Thanks,
- Jake

Re: Simple Searching Question

Posted by Jake Conk <ja...@gmail.com>.
Rob,

Actually I am copying *_facet to text. I have the following for
copyField in my schema:

 <copyField source="*_t" dest="text"/>
 <copyField source="*_facet" dest="text"/>


This is my field configuration in my schema:

 <fields>
   <field name="id" type="string" indexed="true" stored="true"
required="true" />
   <field name="pk_i" type="integer" indexed="true" stored="true"/>
   <field name="pk_s" type="string" indexed="true" stored="true"/>
   <field name="text" type="text" indexed="true" stored="false"
multiValued="true"/>


   <dynamicField name="*_i" type="integer" indexed="true" stored="true"/>
   <dynamicField name="*_t" type="text" indexed="true" stored="true"/>
   <dynamicField name="*_t_stored" type="text" indexed="true" stored="true"/>
   <dynamicField name="*_t_readonly" type="text" indexed="false" stored="true"/>
   <dynamicField name="*_f" type="float" indexed="true" stored="true"/>
   <dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
   <dynamicField name="*_d" type="date" indexed="true" stored="true"/>
   <dynamicField name="*_s" type="string" indexed="true" stored="true"/>
   <dynamicField name="*_ri" type="sint" indexed="true" stored="false"/>

   <dynamicField name="*_rf" type="sfloat" indexed="true" stored="false"/>
   <dynamicField name="*_facet" type="string" indexed="true" stored="true"/>
   <dynamicField name="*_facet_mv" type="string" indexed="true"
stored="true" multiValued="true"/>
   <dynamicField name="*_s_mv" type="string" indexed="true"
stored="false" multiValued="true"/>
   <dynamicField name="*_zh_text" type="text_zh" indexed="true"
stored="false" multiValued="true"/>
   <dynamicField name="*_display" type="text" indexed="false"
stored="true" multiValued="true"/>
 </fields>

Thanks,
- Jake



On Thu, Aug 14, 2008 at 5:49 PM, Rob Casson <ro...@gmail.com> wrote:
> you're likely not copyField-ing *_facet to text, and we'd need to see
> what type of field it is to see how it will be analyzed at both
> search/index time.
>
> the default schema.xml file is pretty well documented, so you might
> want to spend some time looking thru it, and reading the
> comments....lots of good info in there.
>
> cheers,
> rob
>
> On Thu, Aug 14, 2008 at 7:17 PM, Jake Conk <ja...@gmail.com> wrote:
>> Hi Shalin,
>>
>> "foobar_facet" is a dynamic field. Its defined in my schema like this:
>>
>> <dynamicField name="*_facet" type="string" indexed="true" stored="true"/>
>>
>> I have the default search field set to text. Can I use more than one
>> default search field?
>>
>> <defaultSearchField>text</defaultSearchField>
>>
>> Thanks,
>> - Jake
>>
>>
>> On Thu, Aug 14, 2008 at 2:48 PM, Shalin Shekhar Mangar
>> <sh...@gmail.com> wrote:
>>> Hi Jake,
>>>
>>> What is the type of the foobar_facet field in your schema.xml ?
>>> Did you add foobar_facet as the default search field?
>>>
>>> On Fri, Aug 15, 2008 at 3:13 AM, Jake Conk <ja...@gmail.com> wrote:
>>>
>>>> Hello,
>>>>
>>>> I inserted the following documents into Solr:
>>>>
>>>>
>>>> -------------------------------------------------------------------------------------------
>>>>
>>>> <add>
>>>> <doc>
>>>>  <field name="id">124</field>
>>>>  <field name="foobar_facet">Jake Conk</field>
>>>> </doc>
>>>> <doc>
>>>>  <field name="id">125</field>
>>>>  <field name="foobar_facet">Jake Conk</field>
>>>> </doc>
>>>> </add>
>>>>
>>>>
>>>> -------------------------------------------------------------------------------------------
>>>>
>>>> id is the only required integer field.
>>>> foobar_facet is a dynamic string field.
>>>>
>>>> When I try to search for anything with the word Jake in it the
>>>> following ways I get no results.
>>>>
>>>>
>>>> select?q=Jake
>>>> select?q=Jake*
>>>>
>>>>
>>>> I thought one of those two should work but the only way I got it to
>>>> work was by specifying which field "Jake" is in along with a wild
>>>> card.
>>>>
>>>>
>>>> select?q=foobar_facet:Jake*
>>>>
>>>>
>>>> 1) Does this mean for each field I would like to search if Jake exists
>>>> I would have to add each field like I did above to the query?
>>>>
>>>> 2) How would I search if I want to find the name Jake anywhere in the
>>>> string? The documentation
>>>> (http://lucene.apache.org/java/docs/queryparsersyntax.html) states
>>>> that I cannot use a wildcard as the first character such as *Jake*
>>>>
>>>> Thanks,
>>>> - Jake
>>>>
>>>
>>>
>>>
>>> --
>>> Regards,
>>> Shalin Shekhar Mangar.
>>>
>>
>

Re: Simple Searching Question

Posted by Rob Casson <ro...@gmail.com>.
you're likely not copyField-ing *_facet to text, and we'd need to see
what type of field it is to see how it will be analyzed at both
search/index time.

the default schema.xml file is pretty well documented, so you might
want to spend some time looking thru it, and reading the
comments....lots of good info in there.

cheers,
rob

On Thu, Aug 14, 2008 at 7:17 PM, Jake Conk <ja...@gmail.com> wrote:
> Hi Shalin,
>
> "foobar_facet" is a dynamic field. Its defined in my schema like this:
>
> <dynamicField name="*_facet" type="string" indexed="true" stored="true"/>
>
> I have the default search field set to text. Can I use more than one
> default search field?
>
> <defaultSearchField>text</defaultSearchField>
>
> Thanks,
> - Jake
>
>
> On Thu, Aug 14, 2008 at 2:48 PM, Shalin Shekhar Mangar
> <sh...@gmail.com> wrote:
>> Hi Jake,
>>
>> What is the type of the foobar_facet field in your schema.xml ?
>> Did you add foobar_facet as the default search field?
>>
>> On Fri, Aug 15, 2008 at 3:13 AM, Jake Conk <ja...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I inserted the following documents into Solr:
>>>
>>>
>>> -------------------------------------------------------------------------------------------
>>>
>>> <add>
>>> <doc>
>>>  <field name="id">124</field>
>>>  <field name="foobar_facet">Jake Conk</field>
>>> </doc>
>>> <doc>
>>>  <field name="id">125</field>
>>>  <field name="foobar_facet">Jake Conk</field>
>>> </doc>
>>> </add>
>>>
>>>
>>> -------------------------------------------------------------------------------------------
>>>
>>> id is the only required integer field.
>>> foobar_facet is a dynamic string field.
>>>
>>> When I try to search for anything with the word Jake in it the
>>> following ways I get no results.
>>>
>>>
>>> select?q=Jake
>>> select?q=Jake*
>>>
>>>
>>> I thought one of those two should work but the only way I got it to
>>> work was by specifying which field "Jake" is in along with a wild
>>> card.
>>>
>>>
>>> select?q=foobar_facet:Jake*
>>>
>>>
>>> 1) Does this mean for each field I would like to search if Jake exists
>>> I would have to add each field like I did above to the query?
>>>
>>> 2) How would I search if I want to find the name Jake anywhere in the
>>> string? The documentation
>>> (http://lucene.apache.org/java/docs/queryparsersyntax.html) states
>>> that I cannot use a wildcard as the first character such as *Jake*
>>>
>>> Thanks,
>>> - Jake
>>>
>>
>>
>>
>> --
>> Regards,
>> Shalin Shekhar Mangar.
>>
>

Re: Simple Searching Question

Posted by Jake Conk <ja...@gmail.com>.
Hi Shalin,

"foobar_facet" is a dynamic field. Its defined in my schema like this:

<dynamicField name="*_facet" type="string" indexed="true" stored="true"/>

I have the default search field set to text. Can I use more than one
default search field?

<defaultSearchField>text</defaultSearchField>

Thanks,
- Jake


On Thu, Aug 14, 2008 at 2:48 PM, Shalin Shekhar Mangar
<sh...@gmail.com> wrote:
> Hi Jake,
>
> What is the type of the foobar_facet field in your schema.xml ?
> Did you add foobar_facet as the default search field?
>
> On Fri, Aug 15, 2008 at 3:13 AM, Jake Conk <ja...@gmail.com> wrote:
>
>> Hello,
>>
>> I inserted the following documents into Solr:
>>
>>
>> -------------------------------------------------------------------------------------------
>>
>> <add>
>> <doc>
>>  <field name="id">124</field>
>>  <field name="foobar_facet">Jake Conk</field>
>> </doc>
>> <doc>
>>  <field name="id">125</field>
>>  <field name="foobar_facet">Jake Conk</field>
>> </doc>
>> </add>
>>
>>
>> -------------------------------------------------------------------------------------------
>>
>> id is the only required integer field.
>> foobar_facet is a dynamic string field.
>>
>> When I try to search for anything with the word Jake in it the
>> following ways I get no results.
>>
>>
>> select?q=Jake
>> select?q=Jake*
>>
>>
>> I thought one of those two should work but the only way I got it to
>> work was by specifying which field "Jake" is in along with a wild
>> card.
>>
>>
>> select?q=foobar_facet:Jake*
>>
>>
>> 1) Does this mean for each field I would like to search if Jake exists
>> I would have to add each field like I did above to the query?
>>
>> 2) How would I search if I want to find the name Jake anywhere in the
>> string? The documentation
>> (http://lucene.apache.org/java/docs/queryparsersyntax.html) states
>> that I cannot use a wildcard as the first character such as *Jake*
>>
>> Thanks,
>> - Jake
>>
>
>
>
> --
> Regards,
> Shalin Shekhar Mangar.
>

Re: Simple Searching Question

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
Hi Jake,

What is the type of the foobar_facet field in your schema.xml ?
Did you add foobar_facet as the default search field?

On Fri, Aug 15, 2008 at 3:13 AM, Jake Conk <ja...@gmail.com> wrote:

> Hello,
>
> I inserted the following documents into Solr:
>
>
> -------------------------------------------------------------------------------------------
>
> <add>
> <doc>
>  <field name="id">124</field>
>  <field name="foobar_facet">Jake Conk</field>
> </doc>
> <doc>
>  <field name="id">125</field>
>  <field name="foobar_facet">Jake Conk</field>
> </doc>
> </add>
>
>
> -------------------------------------------------------------------------------------------
>
> id is the only required integer field.
> foobar_facet is a dynamic string field.
>
> When I try to search for anything with the word Jake in it the
> following ways I get no results.
>
>
> select?q=Jake
> select?q=Jake*
>
>
> I thought one of those two should work but the only way I got it to
> work was by specifying which field "Jake" is in along with a wild
> card.
>
>
> select?q=foobar_facet:Jake*
>
>
> 1) Does this mean for each field I would like to search if Jake exists
> I would have to add each field like I did above to the query?
>
> 2) How would I search if I want to find the name Jake anywhere in the
> string? The documentation
> (http://lucene.apache.org/java/docs/queryparsersyntax.html) states
> that I cannot use a wildcard as the first character such as *Jake*
>
> Thanks,
> - Jake
>



-- 
Regards,
Shalin Shekhar Mangar.