On Sat, Mar 6, 2010 at 4:20 PM, Devin Austin <devin.aus...@gmail.com> wrote:

>
>
> On Sat, Mar 6, 2010 at 12:13 PM, Erick Erickson 
> <erickerick...@gmail.com>wrote:
>
>> I think the root of your problem is the string type of your default
>> field. That type is untokenized, so if you indexed
>> "my name is erick", the *only* thing that would match
>> is searching for exactly that. Searching for "erick" wouldn't
>> match, nor anything besides the exact and entire value....
>>
>> I suspect text is what you want.
>>
>> It can be a little tricky to get the hang of, but from the
>> admin page, take a look at "schema browser", then
>> click on a field. You'll see the actual terms in your index
>> for a field then. If I'm on track here, you'll see "terms" that
>> are your entire field values whereas you probably expect
>> a term to be a single word.
>>
>> HTH
>> Erick
>>
>> On Sat, Mar 6, 2010 at 11:12 AM, Devin Austin <devin.aus...@gmail.com
>> >wrote:
>>
>> > On Sat, Mar 6, 2010 at 7:34 AM, Erick Erickson <erickerick...@gmail.com
>> > >wrote:
>> >
>> > > At a guess, you're looking in the default field for the letter "i",
>> which
>> > > has probably been removed at indexing time because it is a
>> > > stopword. Unless you specify a field (e.g. q=field:value), the search
>> > > goes against your default field (specified in schema).
>> > >
>> > > Two very useful tools are :
>> > > the solr admin page (blah/solr/admin) and Luke
>> > > (google Lucene Luke) The first lets you browse your solr config
>> > > and peek at your index, the second allows you to examine your
>> > > index in detail.
>> > >
>> > > Also, adding &debugQuery=on will produce a plethora of output.
>> > >
>> > > What does this page tell you?:
>> > > http://localhost:8983/solr/admin/analysis.jsp
>> > >
>> > >
>> > > If all that doesn't help, we need to see your raw query, schema
>> > > definition for the field you're searching and the output of
>> > > &debugQuery=on.
>> > >
>> > > HTH
>> > > Erick
>> > >
>> > >
>> > > On Sat, Mar 6, 2010 at 3:11 AM, Devin Austin <devin.aus...@gmail.com>
>> > > wrote:
>> > >
>> > > > Hi all,
>> > > >
>> > > > Solr newb here.  I'm attempting to index some docs and then search
>> for
>> > > them
>> > > > using the usual XML posts to send the document data to the app.  The
>> > > > documents seem to be indexing as the numDocs under statistics seems
>> to
>> > > > reflect the number of documents I've POSTed.  However, through no
>> > medium
>> > > am
>> > > > I able to retrieve search results.
>> > > >
>> > > > I've tried making requests from Catalyst::Model::WebService::Solr,
>> and
>> > > I've
>> > > > tried through the admin page's "make a query" textarea.
>> > > >
>> > > > I get responses like this:
>> > > >
>> > > >
>> > > >
>> > >
>> >
>> {"responseHeader":{"status":0,"QTime":1,"params":{"q":"i","wt":"json"}},"response":{"numFound":0,"start":0,"docs":[]}}
>> > > >
>> > > > When I *know* there is data indexed.
>> > > >
>> > > > Are things not being committed? Or did I royally fuck something else
>> > up?
>> > > > :-)
>> > > >
>> > > > Thanks in advance,
>> > > >
>> > > > -Devin
>> > > >
>> > > > --
>> > > > Devin Austin
>> > > > http://www.codedright.net
>> > > > 9702906669 - Cell
>> > > >
>> > >
>> >
>> >
>> > Hi Erick,
>> >
>> > Thanks for the prompt response.
>> >
>> > Here's my schema:
>> > <?xml version="1.0" encoding="UTF-8" ?>
>> > <schema name="myschema" version="1.1">
>> >  <types>
>> >    <fieldType name="integer" class="solr.IntField" omitNorms="true"/>
>> >    <fieldType name="string" class="solr.StrField" sortMissingLast="true"
>> > omitNorms="true"/>
>> >  </types>
>> >
>> >  <fields>
>> >    <field name="id" type="integer" indexed="true" stored="true"
>> > required="true" />
>> >    <field name="quotetext" type="string" indexed="true" stored="true" />
>> >  </fields>
>> >
>> >  <uniqueKey>id</uniqueKey>
>> >  <defaultSearchField>quotetext</defaultSearchField>
>> >  <solrQueryParser defaultOperator="AND"/>
>> >
>> > </schema>
>> >
>> >
>> > The output of analysis.jsp:
>> >  Query Analyzer org.apache.solr.schema.FieldType$DefaultAnalyzer {}
>> >  term position 1 term text i can't wait term type word source
>> > start,end 0,12payload
>> >
>> >
>> > The output of &debugOn (*:* is the query):
>> >
>> >
>> >
>> >
>> {"responseHeader":{"status":0,"QTime":0,"params":{"debugQuery":"on","q":"*:*","wt":"json"}},"response":{"numFound":1,"start":0,"docs":[{"quotetext":"i
>> > can't
>> >
>> wait","id":29}]},"debug":{"rawquerystring":"*:*","querystring":"*:*","parsedquery":"MatchAllDocsQuery(*:*)","parsedquery_toString":"*:*","explain":{"29":"\n1.0
>> > = (MATCH) MatchAllDocsQuery, product of:\n  1.0 =
>> >
>> >
>> queryNorm\n"},"QParser":"LuceneQParser","timing":{"time":0.0,"prepare":{"time":0.0,"org.apache.solr.handler.component.QueryComponent":{"time":0.0},"org.apache.solr.handler.component.FacetComponent":{"time":0.0},"org.apache.solr.handler.component.MoreLikeThisComponent":{"time":0.0},"org.apache.solr.handler.component.HighlightComponent":{"time":0.0},"org.apache.solr.handler.component.StatsComponent":{"time":0.0},"org.apache.solr.handler.component.DebugComponent":{"time":0.0}},"process":{"time":0.0,"org.apache.solr.handler.component.QueryComponent":{"time":0.0},"org.apache.solr.handler.component.FacetComponent":{"time":0.0},"org.apache.solr.handler.component.MoreLikeThisComponent":{"time":0.0},"org.apache.solr.handler.component.HighlightComponent":{"time":0.0},"org.apache.solr.handler.component.StatsComponent":{"time":0.0},"org.apache.solr.handler.component.DebugComponent":{"time":0.0}}}}}
>> >
>> >
>> > And the output with debugQuery=on with a query I've been trying to get
>> > results out of:
>> >
>> >
>> {"responseHeader":{"status":0,"QTime":1,"params":{"debugQuery":"on","q":"i
>> > can't
>> >
>> wait","wt":"json"}},"response":{"numFound":0,"start":0,"docs":[]},"debug":{"rawquerystring":"i
>> > can't wait","querystring":"i can't wait","parsedquery":"+quotetext:i
>> > +quotetext:can't +quotetext:wait","parsedquery_toString":"+quotetext:i
>> > +quotetext:can't
>> >
>> >
>> +quotetext:wait","explain":{},"QParser":"LuceneQParser","timing":{"time":1.0,"prepare":{"time":1.0,"org.apache.solr.handler.component.QueryComponent":{"time":1.0},"org.apache.solr.handler.component.FacetComponent":{"time":0.0},"org.apache.solr.handler.component.MoreLikeThisComponent":{"time":0.0},"org.apache.solr.handler.component.HighlightComponent":{"time":0.0},"org.apache.solr.handler.component.StatsComponent":{"time":0.0},"org.apache.solr.handler.component.DebugComponent":{"time":0.0}},"process":{"time":0.0,"org.apache.solr.handler.component.QueryComponent":{"time":0.0},"org.apache.solr.handler.component.FacetComponent":{"time":0.0},"org.apache.solr.handler.component.MoreLikeThisComponent":{"time":0.0},"org.apache.solr.handler.component.HighlightComponent":{"time":0.0},"org.apache.solr.handler.component.StatsComponent":{"time":0.0},"org.apache.solr.handler.component.DebugComponent":{"time":0.0}}}}}
>> >
>> >
>> > I hope that's enough info.  As you can see, *:* is the only thing that
>> > returns results.
>> >
>> >
>> > Thanks,
>> >
>> > -Devin
>> >
>> >
>> > --
>> > Devin Austin
>> > http://www.codedright.net
>> > 9702906669 - Cell
>> >
>>
>
> Ahhhh I was wondering about that.
>
> Thanks a bunch! I'll report back if anything sets itself on fire.
>
> --
> Devin Austin
> http://www.codedright.net
> 9702906669 - Cell
>

Hmm, apparently that didn't work.

Here's my updated schema:

<?xml version="1.0" encoding="UTF-8" ?>
<schema name="myschema" version="1.1">
  <types>
    <fieldType name="integer" class="solr.IntField" omitNorms="true"/>
    <fieldType name="text" class="solr.TextField" sortMissingLast="true"
omitNorms="true"/>
  </types>

  <fields>
    <field name="id" type="integer" indexed="true" stored="true"
required="true" />
    <field name="quotetext" type="text" indexed="true" stored="true" />
  </fields>

  <uniqueKey>id</uniqueKey>
  <defaultSearchField>quotetext</defaultSearchField>
  <solrQueryParser defaultOperator="AND"/>

</schema>


-- 
Devin Austin
http://www.codedright.net
9702906669 - Cell

Reply via email to