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 Marc SCHNEIDER <ma...@gmail.com> on 2011/05/17 09:01:06 UTC

solrj, boost and schema.xml

Hi,

I defined fields in my schema.xml using the boost attribute.
Now I'm using Solrj to index my documents so after having created a
SolrInputDocument I use the addField method.
A boost parameter can be provided.
But how can I read the boost value I defined in schema.xml for that field so
that I can pass it to the addField method?

Thanks in advance,
Marc.

Re: solrj, boost and schema.xml

Posted by Marc SCHNEIDER <ma...@gmail.com>.
Hi,

I was really convinced there was such a field in the schema.xml structure -)
Thanks for you answer!

Marc.

On Tue, May 17, 2011 at 1:59 PM, Erick Erickson <er...@gmail.com>wrote:

> How are you defining a boost for a field in the schema? As far
> as I know there's no such parameter for the <field> tag that Solr
> understands. Solr ignores attributes it doesn't recognize....
>
> So, you'd have to read/parse the schema.xml file (which
> you can get from the admin handler, see the URL generated
> by the admin page when you look at the schema) and find
> the value yourself with normal XML parsing techniques.
>
> At least that's my understanding...
>
> Best
> Erick
>
> On Tue, May 17, 2011 at 3:01 AM, Marc SCHNEIDER
> <ma...@gmail.com> wrote:
> > Hi,
> >
> > I defined fields in my schema.xml using the boost attribute.
> > Now I'm using Solrj to index my documents so after having created a
> > SolrInputDocument I use the addField method.
> > A boost parameter can be provided.
> > But how can I read the boost value I defined in schema.xml for that field
> so
> > that I can pass it to the addField method?
> >
> > Thanks in advance,
> > Marc.
> >
>

Re: solrj, boost and schema.xml

Posted by Erick Erickson <er...@gmail.com>.
How are you defining a boost for a field in the schema? As far
as I know there's no such parameter for the <field> tag that Solr
understands. Solr ignores attributes it doesn't recognize....

So, you'd have to read/parse the schema.xml file (which
you can get from the admin handler, see the URL generated
by the admin page when you look at the schema) and find
the value yourself with normal XML parsing techniques.

At least that's my understanding...

Best
Erick

On Tue, May 17, 2011 at 3:01 AM, Marc SCHNEIDER
<ma...@gmail.com> wrote:
> Hi,
>
> I defined fields in my schema.xml using the boost attribute.
> Now I'm using Solrj to index my documents so after having created a
> SolrInputDocument I use the addField method.
> A boost parameter can be provided.
> But how can I read the boost value I defined in schema.xml for that field so
> that I can pass it to the addField method?
>
> Thanks in advance,
> Marc.
>