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 Pooja Verlani <po...@gmail.com> on 2009/10/06 09:46:13 UTC

Date field being null

Hi,
My fieldtype definition is like:
<fieldType name="solrDate" class="solr.DateField" sortMissingLast="true"
omitNorms="true"/>

I am defining a field:
<field name="UPDATE_DATE" type="solrDate" indexed="false" stored="false" />

Can I have a null for such a field? or is there a way I can use it as a date
field only if the value is null. I cant put the field as a string type as I
have to apply recency sort and some filters for that field.
Regards,
Pooja

Re: Date field being null

Posted by Lance Norskog <go...@gmail.com>.
I think you want "indexed='true' and stored='false'".

If the field is not marked "required=true" then, yes, there can be
"null" fields.

BTW, to search for documents where a value is not set, do this:
    *:* -field:* TO *]

On Tue, Oct 6, 2009 at 1:46 AM, Avlesh Singh <av...@gmail.com> wrote:
>>
>> I am defining a field:
>> <field name="UPDATE_DATE" type="solrDate" indexed="false" stored="false" />
>>
> indexed="false" and stored="false"? really? This field is as good as
> nothing. What would you use it for?
>
> Can I have a null for such a field?
>>
> Yes you can. Moreover, as you have sortMissingLast="true" specified in your
> field type definition, documents having null values in this field would
> appear in the end for any kind of sorting.
>
> Cheers
> Avlesh
>
> On Tue, Oct 6, 2009 at 1:16 PM, Pooja Verlani <po...@gmail.com>wrote:
>
>> Hi,
>> My fieldtype definition is like:
>> <fieldType name="solrDate" class="solr.DateField" sortMissingLast="true"
>> omitNorms="true"/>
>>
>> I am defining a field:
>> <field name="UPDATE_DATE" type="solrDate" indexed="false" stored="false" />
>>
>> Can I have a null for such a field? or is there a way I can use it as a
>> date
>> field only if the value is null. I cant put the field as a string type as I
>> have to apply recency sort and some filters for that field.
>> Regards,
>> Pooja
>>
>



-- 
Lance Norskog
goksron@gmail.com

Re: Date field being null

Posted by Avlesh Singh <av...@gmail.com>.
>
> I am defining a field:
> <field name="UPDATE_DATE" type="solrDate" indexed="false" stored="false" />
>
indexed="false" and stored="false"? really? This field is as good as
nothing. What would you use it for?

Can I have a null for such a field?
>
Yes you can. Moreover, as you have sortMissingLast="true" specified in your
field type definition, documents having null values in this field would
appear in the end for any kind of sorting.

Cheers
Avlesh

On Tue, Oct 6, 2009 at 1:16 PM, Pooja Verlani <po...@gmail.com>wrote:

> Hi,
> My fieldtype definition is like:
> <fieldType name="solrDate" class="solr.DateField" sortMissingLast="true"
> omitNorms="true"/>
>
> I am defining a field:
> <field name="UPDATE_DATE" type="solrDate" indexed="false" stored="false" />
>
> Can I have a null for such a field? or is there a way I can use it as a
> date
> field only if the value is null. I cant put the field as a string type as I
> have to apply recency sort and some filters for that field.
> Regards,
> Pooja
>