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 neuron005 <ne...@gmail.com> on 2011/11/18 12:40:50 UTC

Can files be faceted based on their size ?

*Can fileSize be faceted? *I tried to facet them, but fileSize is of type
string and can not be faceted.
I want to facet my doc and pdf files according to their size. I can
calculate file Size but they are of type string.
What should I do in order to achieve that?
Thanks in advance


--
View this message in context: http://lucene.472066.n3.nabble.com/Can-files-be-faceted-based-on-their-size-tp3518393p3518393.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Can files be faceted based on their size ?

Posted by Erick Erickson <er...@gmail.com>.
Well, you can try adding a <copyField>  directive to put it into
a numeric field....

But you need to provide significantly more details. From what
you've said there's not enough information to say much besides
"it should work".

Perhaps you should review:
http://wiki.apache.org/solr/UsingMailingLists

Best
Erick

On Wed, Nov 23, 2011 at 1:35 AM, neuron005 <ne...@gmail.com> wrote:
> Thanks for replying
> I tried using "Trie" types for faceting solr but that did not solve the
> problem. If I use Trie types(for e.g. I used tlong)...it shows "schema
> mismatch error" as in FileListEntityProcessor api , fileSize has been
> defined of type string. That means we can not apply facet.range on fileSize.
> Am I right?
> Thanks
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Can-files-be-faceted-based-on-their-size-tp3518393p3529923.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Can files be faceted based on their size ?

Posted by neuron005 <ne...@gmail.com>.
Thanks for replying
I tried using "Trie" types for faceting solr but that did not solve the
problem. If I use Trie types(for e.g. I used tlong)...it shows "schema
mismatch error" as in FileListEntityProcessor api , fileSize has been
defined of type string. That means we can not apply facet.range on fileSize.
Am I right? 
Thanks

--
View this message in context: http://lucene.472066.n3.nabble.com/Can-files-be-faceted-based-on-their-size-tp3518393p3529923.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Can files be faceted based on their size ?

Posted by Erick Erickson <er...@gmail.com>.
Well, I wouldn't store it as a string in the first place. Otherwise,
you're right,
you have to store it as an entity that compares lexicographically, usually by
left-padding with zeroes.

But don't do that if at all possible, it's much more expensive than
storing ints or
longs, so can you re-index these as one of the Trie* types?

Best
Erick

On Sat, Nov 19, 2011 at 3:35 AM, neuron005 <ne...@gmail.com> wrote:
> But sir
> fileSize is of type string, how will it compare?
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Can-files-be-faceted-based-on-their-size-tp3518393p3520569.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Can files be faceted based on their size ?

Posted by neuron005 <ne...@gmail.com>.
But sir
fileSize is of type string, how will it compare?

--
View this message in context: http://lucene.472066.n3.nabble.com/Can-files-be-faceted-based-on-their-size-tp3518393p3520569.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Can files be faceted based on their size ?

Posted by Ahmet Arslan <io...@yahoo.com>.
> *Can fileSize be faceted? *I tried to
> facet them, but fileSize is of type
> string and can not be faceted.
> I want to facet my doc and pdf files according to their
> size. I can
> calculate file Size but they are of type string.
> What should I do in order to achieve that?
> Thanks in advance

Since you want to apply range faceting you need to use trie based types.
http://wiki.apache.org/solr/SimpleFacetParameters#Facet_by_Range