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 Anil <an...@gmail.com> on 2016/02/18 07:30:14 UTC

Get one fragment of text of field

Hi ,

we have around 30 fields in solr document. and we search for text in all
fields (by creating a record field with copy field).

few fields have huge text .. order of mbs. how i can get only a  fragment
of fields in a configurable way.

we have to display each field content on UI. so its must to get content of
each field.

for now, i am fetching the content from solr and truncating it in my code.
but it has poor performance.

is there any way to achieve fragmentation (not a highlight fragmentation)
in solr ? please advice.

Regards,
Anil

Re: Get one fragment of text of field

Posted by Anil <an...@gmail.com>.
one way i see is :

store a display snippet in a separate field and fetch that instead

please let me know if you see any other ways or isusue on the appraoch.

Regards,
Anil

On 25 February 2016 at 11:30, Anil <an...@gmail.com> wrote:

> HI,
>
> we are indexing and storing 2 mb text data in a text field. we need to
> display partial content of filed to be displayed in UI every time when this
> document is part of the response.
>
> is there any to get only few characters of the fields ? fetching 2mb data
> and truncate in application is little overhead.
>
> Thanks for your help.
>
> Regards,
> Anil
>
> On 18 February 2016 at 12:51, Anil <an...@gmail.com> wrote:
>
>> Thanks Binoy.
>>
>> index should happen on everything.
>>
>> But retrial/fetch should limit the characters. is it possible ?
>>
>> Regards,
>> Anil
>>
>> On 18 February 2016 at 12:24, Binoy Dalal <bi...@gmail.com> wrote:
>>
>>> If you are not particular about what part of the field is returned you
>>> can
>>> create copy fields and set a limit on those to store only the number of
>>> characters you want.
>>>
>>> <copyField source="src" dest="dest" maxChars="500">
>>>
>>> This will copy over the first 500 chars of the contents of your SRC field
>>> to your dest field.
>>> Anything beyond this will be truncated.
>>>
>>> On Thu, 18 Feb 2016, 12:00 Anil <an...@gmail.com> wrote:
>>>
>>> > Hi ,
>>> >
>>> > we have around 30 fields in solr document. and we search for text in
>>> all
>>> > fields (by creating a record field with copy field).
>>> >
>>> > few fields have huge text .. order of mbs. how i can get only a
>>> fragment
>>> > of fields in a configurable way.
>>> >
>>> > we have to display each field content on UI. so its must to get
>>> content of
>>> > each field.
>>> >
>>> > for now, i am fetching the content from solr and truncating it in my
>>> code.
>>> > but it has poor performance.
>>> >
>>> > is there any way to achieve fragmentation (not a highlight
>>> fragmentation)
>>> > in solr ? please advice.
>>> >
>>> > Regards,
>>> > Anil
>>> >
>>> --
>>> Regards,
>>> Binoy Dalal
>>>
>>
>>
>

Re: Get one fragment of text of field

Posted by Anil <an...@gmail.com>.
HI,

we are indexing and storing 2 mb text data in a text field. we need to
display partial content of filed to be displayed in UI every time when this
document is part of the response.

is there any to get only few characters of the fields ? fetching 2mb data
and truncate in application is little overhead.

Thanks for your help.

Regards,
Anil

On 18 February 2016 at 12:51, Anil <an...@gmail.com> wrote:

> Thanks Binoy.
>
> index should happen on everything.
>
> But retrial/fetch should limit the characters. is it possible ?
>
> Regards,
> Anil
>
> On 18 February 2016 at 12:24, Binoy Dalal <bi...@gmail.com> wrote:
>
>> If you are not particular about what part of the field is returned you can
>> create copy fields and set a limit on those to store only the number of
>> characters you want.
>>
>> <copyField source="src" dest="dest" maxChars="500">
>>
>> This will copy over the first 500 chars of the contents of your SRC field
>> to your dest field.
>> Anything beyond this will be truncated.
>>
>> On Thu, 18 Feb 2016, 12:00 Anil <an...@gmail.com> wrote:
>>
>> > Hi ,
>> >
>> > we have around 30 fields in solr document. and we search for text in all
>> > fields (by creating a record field with copy field).
>> >
>> > few fields have huge text .. order of mbs. how i can get only a
>> fragment
>> > of fields in a configurable way.
>> >
>> > we have to display each field content on UI. so its must to get content
>> of
>> > each field.
>> >
>> > for now, i am fetching the content from solr and truncating it in my
>> code.
>> > but it has poor performance.
>> >
>> > is there any way to achieve fragmentation (not a highlight
>> fragmentation)
>> > in solr ? please advice.
>> >
>> > Regards,
>> > Anil
>> >
>> --
>> Regards,
>> Binoy Dalal
>>
>
>

Re: Get one fragment of text of field

Posted by Binoy Dalal <bi...@gmail.com>.
Indexing will happen on everything.
Just use the copy fields to return data. That's it. They do not need to be
indexed just stored.

On Thu, 18 Feb 2016, 12:52 Anil <an...@gmail.com> wrote:

> Thanks Binoy.
>
> index should happen on everything.
>
> But retrial/fetch should limit the characters. is it possible ?
>
> Regards,
> Anil
>
> On 18 February 2016 at 12:24, Binoy Dalal <bi...@gmail.com> wrote:
>
> > If you are not particular about what part of the field is returned you
> can
> > create copy fields and set a limit on those to store only the number of
> > characters you want.
> >
> > <copyField source="src" dest="dest" maxChars="500">
> >
> > This will copy over the first 500 chars of the contents of your SRC field
> > to your dest field.
> > Anything beyond this will be truncated.
> >
> > On Thu, 18 Feb 2016, 12:00 Anil <an...@gmail.com> wrote:
> >
> > > Hi ,
> > >
> > > we have around 30 fields in solr document. and we search for text in
> all
> > > fields (by creating a record field with copy field).
> > >
> > > few fields have huge text .. order of mbs. how i can get only a
> fragment
> > > of fields in a configurable way.
> > >
> > > we have to display each field content on UI. so its must to get content
> > of
> > > each field.
> > >
> > > for now, i am fetching the content from solr and truncating it in my
> > code.
> > > but it has poor performance.
> > >
> > > is there any way to achieve fragmentation (not a highlight
> fragmentation)
> > > in solr ? please advice.
> > >
> > > Regards,
> > > Anil
> > >
> > --
> > Regards,
> > Binoy Dalal
> >
>
-- 
Regards,
Binoy Dalal

Re: Get one fragment of text of field

Posted by Anil <an...@gmail.com>.
Thanks Binoy.

index should happen on everything.

But retrial/fetch should limit the characters. is it possible ?

Regards,
Anil

On 18 February 2016 at 12:24, Binoy Dalal <bi...@gmail.com> wrote:

> If you are not particular about what part of the field is returned you can
> create copy fields and set a limit on those to store only the number of
> characters you want.
>
> <copyField source="src" dest="dest" maxChars="500">
>
> This will copy over the first 500 chars of the contents of your SRC field
> to your dest field.
> Anything beyond this will be truncated.
>
> On Thu, 18 Feb 2016, 12:00 Anil <an...@gmail.com> wrote:
>
> > Hi ,
> >
> > we have around 30 fields in solr document. and we search for text in all
> > fields (by creating a record field with copy field).
> >
> > few fields have huge text .. order of mbs. how i can get only a  fragment
> > of fields in a configurable way.
> >
> > we have to display each field content on UI. so its must to get content
> of
> > each field.
> >
> > for now, i am fetching the content from solr and truncating it in my
> code.
> > but it has poor performance.
> >
> > is there any way to achieve fragmentation (not a highlight fragmentation)
> > in solr ? please advice.
> >
> > Regards,
> > Anil
> >
> --
> Regards,
> Binoy Dalal
>

Re: Get one fragment of text of field

Posted by Binoy Dalal <bi...@gmail.com>.
If you are not particular about what part of the field is returned you can
create copy fields and set a limit on those to store only the number of
characters you want.

<copyField source="src" dest="dest" maxChars="500">

This will copy over the first 500 chars of the contents of your SRC field
to your dest field.
Anything beyond this will be truncated.

On Thu, 18 Feb 2016, 12:00 Anil <an...@gmail.com> wrote:

> Hi ,
>
> we have around 30 fields in solr document. and we search for text in all
> fields (by creating a record field with copy field).
>
> few fields have huge text .. order of mbs. how i can get only a  fragment
> of fields in a configurable way.
>
> we have to display each field content on UI. so its must to get content of
> each field.
>
> for now, i am fetching the content from solr and truncating it in my code.
> but it has poor performance.
>
> is there any way to achieve fragmentation (not a highlight fragmentation)
> in solr ? please advice.
>
> Regards,
> Anil
>
-- 
Regards,
Binoy Dalal