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 Michael Schmitz <mi...@schmitztech.com> on 2013/05/14 00:14:45 UTC

Solritas truncates content

Hi, I'm playing around with the example that comes with SOLR 4.  I've
indexed some documents using the Tika extractor.  I'm looking at the
velocity templates and trying to figure out how the /browse (solritas)
functionality works because I would like to add functionality to view the
complete document content.  Presently, the content field is truncated in
the results to around 730 characters.  How is this done?  How can I access
the full text?  I've poked around quite a bit but have not found anything.

The content field is added to the result set in richtext-doc.vm:

<div class="result-body">#field('content')</div>

Any help is greatly appreciated!
Peace.  Michael

Re: Solritas truncates content

Posted by Michael Schmitz <mi...@schmitztech.com>.
Thank you for the pointer, this helps me understand what is going on.  I
took out the highlighting branch.  It turns out there is truncation logic
somewhere down there, because when I did, I had the full document text.

Peace.  Michael


On Mon, May 13, 2013 at 6:45 PM, Erik Hatcher <er...@gmail.com>wrote:

> #field is defined in conf/velocity/VM_global_library.vm as:
>
> #macro(field $f)
>   #if($response.response.highlighting.get($docId).get($f).get(0))
>     #set($pad = "")
>     #foreach($v in $response.response.highlighting.get($docId).get($f))
> $pad$v##
>       #set($pad = " ... ")
>     #end
>   #else
>     #foreach($v in $doc.getFieldValues($f))
> $v##
>     #end
>   #end
> #end
>
> It's a little ugly because it supports highlighting if a field has an
> values for that document in the highlighting section of the response.
>
> But if there is no highlighting, then it outputs each value of a field
> as-is from the response.  Are you sure you're getting it truncated?  Try
> adding &wt=xml to the /browse requests you're making and see if perhaps the
> actual value coming back from Solr is the same as what you're seeing
> rendered.  Unless it's from highlighting, it should be the same.
>
>         Erik
>
>
> On May 13, 2013, at 18:14 , Michael Schmitz wrote:
>
> > Hi, I'm playing around with the example that comes with SOLR 4.  I've
> > indexed some documents using the Tika extractor.  I'm looking at the
> > velocity templates and trying to figure out how the /browse (solritas)
> > functionality works because I would like to add functionality to view the
> > complete document content.  Presently, the content field is truncated in
> > the results to around 730 characters.  How is this done?  How can I
> access
> > the full text?  I've poked around quite a bit but have not found
> anything.
> >
> > The content field is added to the result set in richtext-doc.vm:
> >
> > <div class="result-body">#field('content')</div>
> >
> > Any help is greatly appreciated!
> > Peace.  Michael
>
>

Re: Solritas truncates content

Posted by Erik Hatcher <er...@gmail.com>.
#field is defined in conf/velocity/VM_global_library.vm as:

#macro(field $f)
  #if($response.response.highlighting.get($docId).get($f).get(0))
    #set($pad = "")
    #foreach($v in $response.response.highlighting.get($docId).get($f))
$pad$v##
      #set($pad = " ... ")
    #end
  #else
    #foreach($v in $doc.getFieldValues($f))
$v##
    #end
  #end
#end 

It's a little ugly because it supports highlighting if a field has an values for that document in the highlighting section of the response.

But if there is no highlighting, then it outputs each value of a field as-is from the response.  Are you sure you're getting it truncated?  Try adding &wt=xml to the /browse requests you're making and see if perhaps the actual value coming back from Solr is the same as what you're seeing rendered.  Unless it's from highlighting, it should be the same.

	Erik


On May 13, 2013, at 18:14 , Michael Schmitz wrote:

> Hi, I'm playing around with the example that comes with SOLR 4.  I've
> indexed some documents using the Tika extractor.  I'm looking at the
> velocity templates and trying to figure out how the /browse (solritas)
> functionality works because I would like to add functionality to view the
> complete document content.  Presently, the content field is truncated in
> the results to around 730 characters.  How is this done?  How can I access
> the full text?  I've poked around quite a bit but have not found anything.
> 
> The content field is added to the result set in richtext-doc.vm:
> 
> <div class="result-body">#field('content')</div>
> 
> Any help is greatly appreciated!
> Peace.  Michael