Re: Solr 3.3 Sorting is not working for long fields

2011-11-15 Thread kashif.khan
Obviously there is some problem somewhere in the schema or any other files.
the default SOLR demo which is by using the start.jar works well with the
long field. It is just that we do not know where is the problem causing this
error.

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-3-3-Sorting-is-not-working-for-long-fields-tp3499366p3508947.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr 3.3 Sorting is not working for long fields

2011-11-15 Thread rajini maski
All,



On Tue, Nov 15, 2011 at 1:21 PM, kashif.khan uplink2...@gmail.com wrote:

 Obviously there is some problem somewhere in the schema or any other files.
 the default SOLR demo which is by using the start.jar works well with the
 long field. It is just that we do not know where is the problem causing
 this
 error.

 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/Solr-3-3-Sorting-is-not-working-for-long-fields-tp3499366p3508947.html
 Sent from the Solr - User mailing list archive at Nabble.com.



Re: Solr 3.3 Sorting is not working for long fields

2011-11-15 Thread rajini maski
All

I didnt find any mistake in the schema.. below I have psted my
schema file

?xml version=1.0 encoding=UTF-8 ?
!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the License); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an AS IS BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
--

!--
 This is the Solr schema file. This file should be named schema.xml and
 should be in the conf directory under the solr home
 (i.e. ./solr/conf/schema.xml by default)
 or located where the classloader for the Solr webapp can find it.

 This example schema is the recommended starting point for users.
 It should be kept correct and concise, usable out-of-the-box.

 For more information, on how to customize this file, please see
 http://wiki.apache.org/solr/SchemaXml

 PERFORMANCE NOTE: this schema includes many optional features and should
not
 be used for benchmarking.  To improve performance one could
  - set stored=false for all fields possible (esp large fields) when you
only need to search on the field but don't need to return the original
value.
  - set indexed=false if you don't need to search on the field, but only
return the field as a result of searching on other indexed fields.
  - remove all unneeded copyField statements
  - for best index size and searching performance, set index to false
for all general text fields, use copyField to copy them to the
catchall text field, and use that for searching.
  - For maximum indexing performance, use the StreamingUpdateSolrServer
java client.
  - Remember to run the JVM in server mode, and use a higher logging level
that avoids logging every request
--

schema name=example version=1.4
  !-- attribute name is the name of this schema and is only used for
display purposes.
   Applications should change this to reflect the nature of the search
collection.
   version=1.4 is Solr's version number for the schema syntax and
semantics.  It should
   not normally be changed by applications.
   1.0: multiValued attribute did not exist, all fields are multiValued
by nature
   1.1: multiValued attribute introduced, false by default
   1.2: omitTermFreqAndPositions attribute introduced, true by default
except for text fields.
   1.3: removed optional field compress feature
   1.4: default auto-phrase (QueryParser feature) to off
 --

  types
!-- field type definitions. The name attribute is
   just a label to be used by field definitions.  The class
   attribute and any other attributes determine the real
   behavior of the fieldType.
 Class names starting with solr refer to java classes in the
   org.apache.solr.analysis package.
--

!-- The StrField type is not analyzed, but indexed/stored verbatim. --
fieldType name=string class=solr.StrField sortMissingLast=true
omitNorms=true/

!-- boolean type: true or false --
fieldType name=boolean class=solr.BoolField sortMissingLast=true
omitNorms=true/
!--Binary data type. The data should be sent/retrieved in as Base64
encoded Strings --
fieldtype name=binary class=solr.BinaryField/

!-- The optional sortMissingLast and sortMissingFirst attributes are
 currently supported on types that are sorted internally as strings.
   This includes
string,boolean,sint,slong,sfloat,sdouble,pdate
   - If sortMissingLast=true, then a sort on this field will cause
documents
 without the field to come after documents with the field,
 regardless of the requested sort order (asc or desc).
   - If sortMissingFirst=true, then a sort on this field will cause
documents
 without the field to come before documents with the field,
 regardless of the requested sort order.
   - If sortMissingLast=false and sortMissingFirst=false (the
default),
 then default lucene sorting will be used which places docs without
the
 field first in an ascending sort and last in a descending sort.
--

!--
  Default numeric field types. For faster range queries, consider the
tint/tfloat/tlong/tdouble types.
--
fieldType name=int class=solr.TrieIntField precisionStep=0
omitNorms=true positionIncrementGap=0/
fieldType name=float class=solr.TrieFloatField precisionStep=0
omitNorms=true positionIncrementGap=0/
fieldType name=long class=solr.TrieLongField precisionStep=0

Re: Solr 3.3 Sorting is not working for long fields

2011-11-15 Thread Michael Kuhlmann

Hi,

Am 15.11.2011 10:25, schrieb rajini maski:

 fieldType name=long class=solr.TrieLongField precisionStep=0
omitNorms=true positionIncrementGap=0/


[...]


 fieldType name=tlong class=solr.TrieLongField precisionStep=8
omitNorms=true positionIncrementGap=0/


[...]


field name=studyid type=long indexed=true stored=true/


Hmh, why didn't you just changed the field type to tlong as you 
mentioned before? Instead you changed the class of the long type. 
There's nothing against this, it's just a bit confusing since long 
fields normally are of type solr.LongField, which is not sortable on its 
own.


You specified a precisionStep of 0, which means that the field would be 
slow in range queries, but it shouldn't harm for sorting. All in all, it 
should work.


So, the only chance I see is to re-index once again (and commit after 
that). I don't really see an error in your config except the confusing 
long type. It should work after reindexing, and it can't work if it 
was indexed with a genuine long type.


-Kuli


Re: Solr 3.3 Sorting is not working for long fields

2011-11-15 Thread rajini maski
Thankyou for the responses :)

  Found that the bug was in naming convention of fields. (for tlong/long )
I had given a number character as a name of the field.
Studyid field name was - 450 , Changed it to S450 and it started working :)

Thank you all.

Regards,
Rajani




On Tue, Nov 15, 2011 at 3:28 PM, Michael Kuhlmann k...@solarier.de wrote:

 Hi,

 Am 15.11.2011 10:25, schrieb rajini maski:

  fieldType name=long class=solr.TrieLongField precisionStep=0
 omitNorms=true positionIncrementGap=0/


 [...]


  fieldType name=tlong class=solr.TrieLongField precisionStep=8
 omitNorms=true positionIncrementGap=0/


 [...]


 field name=studyid type=long indexed=true stored=true/


 Hmh, why didn't you just changed the field type to tlong as you mentioned
 before? Instead you changed the class of the long type. There's nothing
 against this, it's just a bit confusing since long fields normally are of
 type solr.LongField, which is not sortable on its own.

 You specified a precisionStep of 0, which means that the field would be
 slow in range queries, but it shouldn't harm for sorting. All in all, it
 should work.

 So, the only chance I see is to re-index once again (and commit after
 that). I don't really see an error in your config except the confusing
 long type. It should work after reindexing, and it can't work if it was
 indexed with a genuine long type.

 -Kuli



Re: Solr 3.3 Sorting is not working for long fields

2011-11-14 Thread rajini maski
Field type is long and not multi valued.
Using solr 3.3 war file ,
Tried on solr 1.4.1 index and solr 3.3 index , both cases its not working.

query :
http://localhost:8091/Group/select?/indent=onq=studyid:120sort=studyidasc,groupid
asc,subjectid ascstart=0rows=10

all the ID fields are long

Thanks  Regards
Rajani


On Sun, Nov 13, 2011 at 7:58 AM, Erick Erickson erickerick...@gmail.comwrote:

 Well, 3.3 has been around for quite a while, I'd suspect that
 something this fundamental would have been found...

 Is your field multi-valued? And what kind of field is
 studyid?

 You really have to provide more details, input, output, etc
 to get reasonable help. It might help to review:

 http://wiki.apache.org/solr/UsingMailingLists

 Best
 Erick

 On Fri, Nov 11, 2011 at 5:52 AM, rajini maski rajinima...@gmail.com
 wrote:
  Hi,
 
  I have upgraded my Solr from 1.4.1 to 3.3.Now I tried to sort
  on a long field and documents are not getting sorted based on that.
 
  Sort is working when we do sorting on facet ex:facet=on
 facet.sort=studyid
 
  But when do simple sort on documents , sort=studyid,  sort doesn't
 happen.
  Is there any bug ?
 
 
 
  Regards,
  Rajani
 



Re: Solr 3.3 Sorting is not working for long fields

2011-11-14 Thread Michael Kuhlmann

Am 14.11.2011 09:33, schrieb rajini maski:

query :
http://localhost:8091/Group/select?/indent=onq=studyid:120sort=studyidasc,groupid
asc,subjectid ascstart=0rows=10


Is it a copy-and-paste error, or did you realls sort on studyidasc?

I don't think you have a field studyidasc, and Solr should've given an 
exception that either asc or desc is missing.


-Kuli


Re: Solr 3.3 Sorting is not working for long fields

2011-11-14 Thread rajini maski
There is no error as such.

When I do a basic sort on *long *field. the sort doesn't happen.


Query is :

-http://blr-ws-195:8091/Solr3.3/select/?q=2%3A104+AND+526%3A27747version=2.2start=0rows=10indent=onsort=469%20ascfl=469#
lst name=*responseHeader*
  int name=*status*0/int
  int name=*QTime*3/int
 
-http://blr-ws-195:8091/Solr3.3/select/?q=2%3A104+AND+526%3A27747version=2.2start=0rows=10indent=onsort=469%20ascfl=469#
lst name=*params*
  str name=*fl*studyid/str
  str name=*sort*studyid asc/str
  str name=*indent*on/str
  str name=*start*0/str
  str name=*q**:*/str
  str name=*rows*100/str
  str name=*version*2.2/str
 /lst
 /lst




response
- result name=response numFound=216 start=0
- doc
  long name=studyid53/long 
  /doc
- doc
  long name=studyid18/int
  /doc
- doc
  long name=studyid14/long 
  /doc
- doc
  int name=studyid11/long 
  /doc
- doc
  long name=studyid7/long 
  /doc
- doc
  int name=studyid63/int
  /doc
- doc
  int name=studyid35/long 
  /doc
- doc
  int name=studyid70/long 
  /doc
- doc
  long name=studyid91/long 
  /doc
- doc
  int name=studyid97/int
  /doc
  /result
  /response


The same case works with Solr1.4.1 but it is not working solr 3.3


Regards,
Rajani

On Mon, Nov 14, 2011 at 2:23 PM, Michael Kuhlmann k...@solarier.de wrote:

 Am 14.11.2011 09:33, schrieb rajini maski:

 query :
 http://localhost:8091/Group/**select?/indent=onq=studyid:**
 120sort=studyidasc,groupidhttp://localhost:8091/Group/select?/indent=onq=studyid:120sort=studyidasc,groupid
 asc,subjectid ascstart=0rows=10


 Is it a copy-and-paste error, or did you realls sort on studyidasc?

 I don't think you have a field studyidasc, and Solr should've given an
 exception that either asc or desc is missing.

 -Kuli



Re: Solr 3.3 Sorting is not working for long fields

2011-11-14 Thread Ahmet Arslan
 When I do a basic sort on *long *field. the sort doesn't
 happen.
 
 
 Query is :
 
 -http://blr-ws-195:8091/Solr3.3/select/?q=2%3A104+AND+526%3A27747version=2.2start=0rows=10indent=onsort=469%20ascfl=469#
 lst name=*responseHeader*
   int name=*status*0/int
   int name=*QTime*3/int
  
 -http://blr-ws-195:8091/Solr3.3/select/?q=2%3A104+AND+526%3A27747version=2.2start=0rows=10indent=onsort=469%20ascfl=469#
 lst name=*params*
   str name=*fl*studyid/str
   str name=*sort*studyid asc/str
   str name=*indent*on/str
   str name=*start*0/str
   str name=*q**:*/str
   str name=*rows*100/str
   str name=*version*2.2/str
  /lst
  /lst
 
 
 
 
 response
 - result name=response numFound=216 start=0
 - doc
   long name=studyid53/long 
   /doc
 - doc
   long name=studyid18/int
   /doc
 - doc
   long name=studyid14/long 
   /doc
 - doc
   int name=studyid11/long 
   /doc
 - doc
   long name=studyid7/long 
   /doc
 - doc
   int name=studyid63/int
   /doc
 - doc
   int name=studyid35/long 
   /doc
 - doc
   int name=studyid70/long 
   /doc
 - doc
   long name=studyid91/long 
   /doc
 - doc
   int name=studyid97/int
   /doc
   /result
   /response
 
 
 The same case works with Solr1.4.1 but it is not working
 solr 3.3

Can you try with the following type?

  fieldType name=tlong class=solr.TrieLongField precisionStep=8 
omitNorms=true positionIncrementGap=0/

And studyid must be marked as indexed=true.


Re: Solr 3.3 Sorting is not working for long fields

2011-11-14 Thread rajini maski
I

On Mon, Nov 14, 2011 at 7:23 PM, Ahmet Arslan iori...@yahoo.com wrote:

  When I do a basic sort on *long *field. the sort doesn't
  happen.
 
 
  Query is :
 
  -
 http://blr-ws-195:8091/Solr3.3/select/?q=2%3A104+AND+526%3A27747version=2.2start=0rows=10indent=onsort=469%20ascfl=469#
 
  lst name=*responseHeader*
int name=*status*0/int
int name=*QTime*3/int
   -
 http://blr-ws-195:8091/Solr3.3/select/?q=2%3A104+AND+526%3A27747version=2.2start=0rows=10indent=onsort=469%20ascfl=469#
 
  lst name=*params*
str name=*fl*studyid/str
str name=*sort*studyid asc/str
str name=*indent*on/str
str name=*start*0/str
str name=*q**:*/str
str name=*rows*100/str
str name=*version*2.2/str
   /lst
   /lst
 
 
 
 
  response
  - result name=response numFound=216 start=0
  - doc
long name=studyid53/long 
/doc
  - doc
long name=studyid18/int
/doc
  - doc
long name=studyid14/long 
/doc
  - doc
int name=studyid11/long 
/doc
  - doc
long name=studyid7/long 
/doc
  - doc
int name=studyid63/int
/doc
  - doc
int name=studyid35/long 
/doc
  - doc
int name=studyid70/long 
/doc
  - doc
long name=studyid91/long 
/doc
  - doc
int name=studyid97/int
/doc
/result
/response
 
 
  The same case works with Solr1.4.1 but it is not working
  solr 3.3

 Can you try with the following type?

  fieldType name=tlong class=solr.TrieLongField precisionStep=8
 omitNorms=true positionIncrementGap=0/

 And studyid must be marked as indexed=true.



I tried this one.   fieldType name=tlong class=solr.TrieLongField
precisionStep=8 omitNorms=true positionIncrementGap=0/

It didn't work :(

Sort didn't happen


Re: Solr 3.3 Sorting is not working for long fields

2011-11-14 Thread Ahmet Arslan
 I tried this one.   fieldType
 name=tlong class=solr.TrieLongField
 precisionStep=8 omitNorms=true
 positionIncrementGap=0/
 
 It didn't work :(
 
 Sort didn't happen


Did you restart tomcat and perform re-index?


Re: Solr 3.3 Sorting is not working for long fields

2011-11-14 Thread rajini maski
Yes .

On 11/14/11, Ahmet Arslan iori...@yahoo.com wrote:
 I tried this one.   fieldType
 name=tlong class=solr.TrieLongField
 precisionStep=8 omitNorms=true
 positionIncrementGap=0/

 It didn't work :(

 Sort didn't happen


 Did you restart tomcat and perform re-index?



Re: Solr 3.3 Sorting is not working for long fields

2011-11-14 Thread Ahmet Arslan
 Yes .


  Did you restart tomcat and perform re-index?
 
 

Okey, one thing left. Http caching may cause stale response. Delete your 
browsers cache if you are using a browser to query solr. 


Re: Solr 3.3 Sorting is not working for long fields

2011-11-12 Thread Erick Erickson
Well, 3.3 has been around for quite a while, I'd suspect that
something this fundamental would have been found...

Is your field multi-valued? And what kind of field is
studyid?

You really have to provide more details, input, output, etc
to get reasonable help. It might help to review:

http://wiki.apache.org/solr/UsingMailingLists

Best
Erick

On Fri, Nov 11, 2011 at 5:52 AM, rajini maski rajinima...@gmail.com wrote:
 Hi,

             I have upgraded my Solr from 1.4.1 to 3.3.Now I tried to sort
 on a long field and documents are not getting sorted based on that.

 Sort is working when we do sorting on facet ex:facet=on facet.sort=studyid

 But when do simple sort on documents , sort=studyid,  sort doesn't happen.
 Is there any bug ?



 Regards,
 Rajani