[lucy-dev] Field data type besides string and text

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[lucy-dev] Field data type besides string and text

bhardwajrajesh1973@gmail.com
Hello,
Lucene provides field data types as :-
TextField: Reader or String indexed for full-text search
StringField: String indexed verbatim as a single token
IntPoint: int indexed for exact/range queries.
LongPoint: long indexed for exact/range queries.
FloatPoint: float indexed for exact/range queries.
DoublePoint: double indexed for exact/range queries.
SortedDocValuesField: byte[] indexed column-wise for sorting/faceting
SortedSetDocValuesField: SortedSet<byte[]> indexed column-wise for sorting/faceting
NumericDocValuesField: long indexed column-wise for sorting/faceting
SortedNumericDocValuesField: SortedSet<long> indexed column-wise for sorting/faceting
StoredField: Stored-only value for retrieving in summary results

but in apache lucy - its just String and text . Is there any particular reason for not having other data types.

And If I want to implement, can some one please provide me some pointers, so I can contribute it development of this feature
Reply | Threaded
Open this post in threaded view
|

Re: [lucy-dev] Field data type besides string and text

Peter Karman
[hidden email] wrote on 3/14/18 4:03 PM:

> Hello,
> Lucene provides field data types as :-
> TextField: Reader or String indexed for full-text search
> StringField: String indexed verbatim as a single token
> IntPoint: int indexed for exact/range queries.
> LongPoint: long indexed for exact/range queries.
> FloatPoint: float indexed for exact/range queries.
> DoublePoint: double indexed for exact/range queries.
> SortedDocValuesField: byte[] indexed column-wise for sorting/faceting
> SortedSetDocValuesField: SortedSet<byte[]> indexed column-wise for sorting/faceting
> NumericDocValuesField: long indexed column-wise for sorting/faceting
> SortedNumericDocValuesField: SortedSet<long> indexed column-wise for sorting/faceting
> StoredField: Stored-only value for retrieving in summary results
>
> but in apache lucy - its just String and text . Is there any particular reason for not having other data types.
>
> And If I want to implement, can some one please provide me some pointers, so I can contribute it development of this feature
>

The numeric field types in Lucy have long been a present-but-undocumented
because we've taken a pretty conservative approach to the public API.

https://github.com/apache/lucy/blob/master/core/Lucy/Plan/NumericType.cfh

https://metacpan.org/source/NWELLNHOF/Lucy-0.6.2/lib/Lucy/Plan/Int64Type.pm

The sorting and storing aspects of Lucene field types are present, but as
attributes on the existing field types. See e.g.

https://lucy.apache.org/docs/perl/Lucy/Plan/FieldType.html

If you wanted to implement your own field type, I expect it would depend on what
language implementation you wanted to do it in. In Perl, you could start by
subclassing an existing type and extending it, just as you would any other Perl
class.


--
Peter Karman  .  he/him/his  .  https://karpet.github.io/
Reply | Threaded
Open this post in threaded view
|

Re: [lucy-dev] Field data type besides string and text

bhardwajrajesh1973@gmail.com


On 2018/03/14 21:40:27, Peter Karman <[hidden email]> wrote:

> [hidden email] wrote on 3/14/18 4:03 PM:
> > Hello,
> > Lucene provides field data types as :-
> > TextField: Reader or String indexed for full-text search
> > StringField: String indexed verbatim as a single token
> > IntPoint: int indexed for exact/range queries.
> > LongPoint: long indexed for exact/range queries.
> > FloatPoint: float indexed for exact/range queries.
> > DoublePoint: double indexed for exact/range queries.
> > SortedDocValuesField: byte[] indexed column-wise for sorting/faceting
> > SortedSetDocValuesField: SortedSet<byte[]> indexed column-wise for sorting/faceting
> > NumericDocValuesField: long indexed column-wise for sorting/faceting
> > SortedNumericDocValuesField: SortedSet<long> indexed column-wise for sorting/faceting
> > StoredField: Stored-only value for retrieving in summary results
> >
> > but in apache lucy - its just String and text . Is there any particular reason for not having other data types.
> >
> > And If I want to implement, can some one please provide me some pointers, so I can contribute it development of this feature
> >
>
> The numeric field types in Lucy have long been a present-but-undocumented
> because we've taken a pretty conservative approach to the public API.
>
> https://github.com/apache/lucy/blob/master/core/Lucy/Plan/NumericType.cfh
>
> https://metacpan.org/source/NWELLNHOF/Lucy-0.6.2/lib/Lucy/Plan/Int64Type.pm
>
> The sorting and storing aspects of Lucene field types are present, but as
> attributes on the existing field types. See e.g.
>
> https://lucy.apache.org/docs/perl/Lucy/Plan/FieldType.html
>
> If you wanted to implement your own field type, I expect it would depend on what
> language implementation you wanted to do it in. In Perl, you could start by
> subclassing an existing type and extending it, just as you would any other Perl
> class.
>
>
> --
> Peter Karman  .  he/him/his  .  https://karpet.github.io/
>

Thanks . I want to use C++ , so I think I am good with .c implementation.

Is there a reason these field types are not mentioned as part of API, do you see possible issues in using them
Reply | Threaded
Open this post in threaded view
|

Re: [lucy-dev] Field data type besides string and text

Nick Wellnhofer
On 15/03/2018 00:16, [hidden email] wrote:
> On 2018/03/14 21:40:27, Peter Karman <[hidden email]> wrote:
>> The numeric field types in Lucy have long been a present-but-undocumented
>> because we've taken a pretty conservative approach to the public API.

> Is there a reason these field types are not mentioned as part of API, do you see possible issues in using them

The numeric types should work as expected. I think it's just an oversight that
they're missing from the documentation.

Nick