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 Gabriele Kahlout <ga...@mysimpatico.com> on 2011/07/13 16:19:09 UTC

How to add TrieIntField to a SolrInputDocument?

        SolrInputDocument doc = new SolrInputDocument();
        doc.setField(id, "0");
        doc.setField("url", getURL("0"));
        doc.setField(content, "blah blah blah");
*        doc.setField(wc, 150); //wc is of solr.TrieIntField field type in
schema.xml*
        assertU(adoc(doc));
        assertU(commit());
        assertNumFound(1);

The above test fails until I change the following in schema.xml:
 - <fieldType name="int" class="solr.*TrieIntField*" omitNorms="true"/>
 + <fieldType name="int" class="solr.*IntField*" omitNorms="true"/>


On Sun, Jul 10, 2011 at 10:36 PM, Gabriele Kahlout <gabriele@mysimpatico.com
> wrote:

>
> This was my problem:
>         <fieldType name="int" class="solr.TrieIntField" omitNorms="true"/>
>
> I had taken my queu from Nutch's schema:
> <fieldType name="long" class="solr.LongField" omitNorms="true"/>
>
>
>
> On Sat, Jul 9, 2011 at 4:55 PM, Yonik Seeley <yo...@lucidimagination.com>wrote:
>
>> Something is wrong with your indexing.
>> Is "wc" an indexed field?  If not, change it so it is, then re-index your
>> data.
>>
>> If so, I'd recommend starting with the example data and filter for
>> something like popularity:[6 TO 10] to convince yourself it works,
>> then figuring out what you did differently in your schema/data.
>>
>> -Yonik
>> http://www.lucidimagination.com
>>
>> On Sat, Jul 9, 2011 at 10:50 AM, Gabriele Kahlout
>> <ga...@mysimpatico.com> wrote:
>> > http://localhost:8080/solr/select?indent=on&version=2.2&q=*%3A**
>> > &fq=wc%3A%5B255+TO+257%5D*
>> > &start=0&rows=10&fl=*%2Cscore&qt=&wt=xml&explainOther=&hl.fl=
>> >
>> > The toString of the request:
>> >
>> {explainOther=&fl=*,score&indent=on&start=0&q=*:*&hl.fl=&qt=&wt=xml&fq=wc:[255+TO+257]&rows=10000&version=2.2}
>> >
>> > Even when the FilterQuery is constructed in Java it doesn't work (i get
>> > results that ignore the filter query completely).
>> >
>> >
>> > On Sat, Jul 9, 2011 at 3:40 PM, Ahmet Arslan <io...@yahoo.com> wrote:
>> >
>> >> > I don't get it to work!
>> >> >
>> >> > If I specify no fq I get the first result with <int
>> >> > name="wc">256</int>
>> >> >
>> >> > With wc:[255 TO 257] (fq=wc%3A%5B255+TO+257%5D) nothing
>> >> > comes out.
>> >>
>> >> If you give us the Full URL you are using, it can be helpful.
>> >>
>> >> Correct syntax is &fq=wc:[255 TO 257]
>> >>
>> >> You can use more that fq in a request.
>> >>
>> >>
>> >
>> >
>> > --
>> > Regards,
>> > K. Gabriele
>> >
>> > --- unchanged since 20/9/10 ---
>> > P.S. If the subject contains "[LON]" or the addressee acknowledges the
>> > receipt within 48 hours then I don't resend the email.
>> > subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧
>> time(x)
>> > < Now + 48h) ⇒ ¬resend(I, this).
>> >
>> > If an email is sent by a sender that is not a trusted contact or the
>> email
>> > does not contain a valid code then the email is not received. A valid
>> code
>> > starts with a hyphen and ends with "X".
>> > ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
>> > L(-[a-z]+[0-9]X)).
>> >
>>
>
>
>
> --
> Regards,
> K. Gabriele
>
> --- unchanged since 20/9/10 ---
> P.S. If the subject contains "[LON]" or the addressee acknowledges the
> receipt within 48 hours then I don't resend the email.
> subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧
> time(x) < Now + 48h) ⇒ ¬resend(I, this).
>
> If an email is sent by a sender that is not a trusted contact or the email
> does not contain a valid code then the email is not received. A valid code
> starts with a hyphen and ends with "X".
> ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
> L(-[a-z]+[0-9]X)).
>
>


-- 
Regards,
K. Gabriele

--- unchanged since 20/9/10 ---
P.S. If the subject contains "[LON]" or the addressee acknowledges the
receipt within 48 hours then I don't resend the email.
subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧ time(x)
< Now + 48h) ⇒ ¬resend(I, this).

If an email is sent by a sender that is not a trusted contact or the email
does not contain a valid code then the email is not received. A valid code
starts with a hyphen and ends with "X".
∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
L(-[a-z]+[0-9]X)).

Re: How to add TrieIntField to a SolrInputDocument?

Posted by Gabriele Kahlout <ga...@mysimpatico.com>.
this works:

        doc.remove("wc");
        SolrInputField wcField = new SolrInputField("wc");
        wcField.setValue(150, 1.0f);
        doc.put("wc",wcField);

On Wed, Jul 13, 2011 at 4:19 PM, Gabriele Kahlout
<ga...@mysimpatico.com>wrote:

>         SolrInputDocument doc = new SolrInputDocument();
>         doc.setField(id, "0");
>         doc.setField("url", getURL("0"));
>         doc.setField(content, "blah blah blah");
> *        doc.setField(wc, 150); //wc is of solr.TrieIntField field type in
> schema.xml*
>         assertU(adoc(doc));
>         assertU(commit());
>         assertNumFound(1);
>
> The above test fails until I change the following in schema.xml:
>  - <fieldType name="int" class="solr.*TrieIntField*" omitNorms="true"/>
>  + <fieldType name="int" class="solr.*IntField*" omitNorms="true"/>
>
>
> On Sun, Jul 10, 2011 at 10:36 PM, Gabriele Kahlout <
> gabriele@mysimpatico.com> wrote:
>
>>
>> This was my problem:
>>         <fieldType name="int" class="solr.TrieIntField" omitNorms="true"/>
>>
>> I had taken my queu from Nutch's schema:
>> <fieldType name="long" class="solr.LongField" omitNorms="true"/>
>>
>>
>>
>> On Sat, Jul 9, 2011 at 4:55 PM, Yonik Seeley <yo...@lucidimagination.com>wrote:
>>
>>> Something is wrong with your indexing.
>>> Is "wc" an indexed field?  If not, change it so it is, then re-index your
>>> data.
>>>
>>> If so, I'd recommend starting with the example data and filter for
>>> something like popularity:[6 TO 10] to convince yourself it works,
>>> then figuring out what you did differently in your schema/data.
>>>
>>> -Yonik
>>> http://www.lucidimagination.com
>>>
>>> On Sat, Jul 9, 2011 at 10:50 AM, Gabriele Kahlout
>>> <ga...@mysimpatico.com> wrote:
>>> > http://localhost:8080/solr/select?indent=on&version=2.2&q=*%3A**
>>> > &fq=wc%3A%5B255+TO+257%5D*
>>> > &start=0&rows=10&fl=*%2Cscore&qt=&wt=xml&explainOther=&hl.fl=
>>> >
>>> > The toString of the request:
>>> >
>>> {explainOther=&fl=*,score&indent=on&start=0&q=*:*&hl.fl=&qt=&wt=xml&fq=wc:[255+TO+257]&rows=10000&version=2.2}
>>> >
>>> > Even when the FilterQuery is constructed in Java it doesn't work (i get
>>> > results that ignore the filter query completely).
>>> >
>>> >
>>> > On Sat, Jul 9, 2011 at 3:40 PM, Ahmet Arslan <io...@yahoo.com>
>>> wrote:
>>> >
>>> >> > I don't get it to work!
>>> >> >
>>> >> > If I specify no fq I get the first result with <int
>>> >> > name="wc">256</int>
>>> >> >
>>> >> > With wc:[255 TO 257] (fq=wc%3A%5B255+TO+257%5D) nothing
>>> >> > comes out.
>>> >>
>>> >> If you give us the Full URL you are using, it can be helpful.
>>> >>
>>> >> Correct syntax is &fq=wc:[255 TO 257]
>>> >>
>>> >> You can use more that fq in a request.
>>> >>
>>> >>
>>> >
>>> >
>>> > --
>>> > Regards,
>>> > K. Gabriele
>>> >
>>> > --- unchanged since 20/9/10 ---
>>> > P.S. If the subject contains "[LON]" or the addressee acknowledges the
>>> > receipt within 48 hours then I don't resend the email.
>>> > subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧
>>> time(x)
>>> > < Now + 48h) ⇒ ¬resend(I, this).
>>> >
>>> > If an email is sent by a sender that is not a trusted contact or the
>>> email
>>> > does not contain a valid code then the email is not received. A valid
>>> code
>>> > starts with a hyphen and ends with "X".
>>> > ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y
>>> ∈
>>> > L(-[a-z]+[0-9]X)).
>>> >
>>>
>>
>>
>>
>> --
>> Regards,
>> K. Gabriele
>>
>> --- unchanged since 20/9/10 ---
>> P.S. If the subject contains "[LON]" or the addressee acknowledges the
>> receipt within 48 hours then I don't resend the email.
>> subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧
>> time(x) < Now + 48h) ⇒ ¬resend(I, this).
>>
>> If an email is sent by a sender that is not a trusted contact or the email
>> does not contain a valid code then the email is not received. A valid code
>> starts with a hyphen and ends with "X".
>> ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
>> L(-[a-z]+[0-9]X)).
>>
>>
>
>
> --
> Regards,
> K. Gabriele
>
> --- unchanged since 20/9/10 ---
> P.S. If the subject contains "[LON]" or the addressee acknowledges the
> receipt within 48 hours then I don't resend the email.
> subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧
> time(x) < Now + 48h) ⇒ ¬resend(I, this).
>
> If an email is sent by a sender that is not a trusted contact or the email
> does not contain a valid code then the email is not received. A valid code
> starts with a hyphen and ends with "X".
> ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
> L(-[a-z]+[0-9]X)).
>
>


-- 
Regards,
K. Gabriele

--- unchanged since 20/9/10 ---
P.S. If the subject contains "[LON]" or the addressee acknowledges the
receipt within 48 hours then I don't resend the email.
subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧ time(x)
< Now + 48h) ⇒ ¬resend(I, this).

If an email is sent by a sender that is not a trusted contact or the email
does not contain a valid code then the email is not received. A valid code
starts with a hyphen and ends with "X".
∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
L(-[a-z]+[0-9]X)).