Solr query - Is there a way to limit the size of a text field in the response -
is there way limit amount of text in text field query? here's quick scenario....
i have 2 fields:
- docid - int
- text - string.
i query docid field , want "preview" text text field of 200 chars. on average, text field has 600-2000 chars need preview.
eg. [mysolrcore]/select?q=docid:123&fl=text
is there way since don't see point of bringing entire text field if need small preview?
i'm not looking @ hit highlighting since i'm not searching specific text within text field if there similar functionaly of hl.fragsize parameter great!
hope can point me in right direction!
cheers!
you have test performance of work-around versus returning entire field, might work situation. basically, turn on highlighting on field won't match, , use alternate field return limited number of characters want.
http://solr:8080/solr/select/?q=*:*&rows=10&fl=author,title&hl=true&hl.snippets=0&hl.fl=sku&hl.fragsize=0&hl.alternatefield=description&hl.maxalternatefieldlength=50
notes:
- make sure alternate field not exist in field list (fl) parameter
- make sure highlighting field (hl.fl) not contain text want search
i find cpu cost of running highlighter more cpu cost , bandwidth of returning whole field. you'll have experiment.
Comments
Post a Comment