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 "kiran.bodigam" <ki...@gmail.com> on 2011/10/03 15:28:21 UTC

UniqueKey filed length exceeds

I have defined time stamp as unique key but when i trying to search with the
same it throws error any other alternate for StrField coz i can't increase
the length of it or can't we apply analyzer for the same? 
My unique key:YYYY-MM-DD 13:54:11.414632 

--
View this message in context: http://lucene.472066.n3.nabble.com/UniqueKey-filed-length-exceeds-tp3389759p3389759.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: UniqueKey filed length exceeds

Posted by "kiran.bodigam" <ki...@gmail.com>.
Thanks Jamie it worked


--
View this message in context: http://lucene.472066.n3.nabble.com/UniqueKey-filed-length-exceeds-tp3389759p3393354.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: UniqueKey filed length exceeds

Posted by Ahmet Arslan <io...@yahoo.com>.
>  I would like to know how we can achieve the *range search*
> for these date
> formats like  [2011-11-02:10 03:37.236088 to
> 2011-12-02:10 03:37.236088]..?


You can use frange query parser plugin.

http://www.lucidimagination.com/blog/2009/07/06/ranges-over-functions-in-solr-14/


Re: UniqueKey filed length exceeds

Posted by "kiran.bodigam" <ki...@gmail.com>.
Thanks for u reply guys,

As suggest both formats q={!term f=object}2011-11-02:10 03:37.236088 and
2011-11-02\:10\:03\:37.236088  has worked perfectly for search.
 I would like to know how we can achieve the *range search* for these date
formats like  [2011-11-02:10 03:37.236088 to 2011-12-02:10 03:37.236088]..?
do i need to convert them to below format 
[20111102100337236088 to 20111202100337236088] or any other alternative
please suggest..?

--
View this message in context: http://lucene.472066.n3.nabble.com/UniqueKey-filed-length-exceeds-tp3389759p3409102.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: UniqueKey filed length exceeds

Posted by Chris Hostetter <ho...@fucit.org>.
: if you'd like to make a query like this you need to escape the : so
: something like

or use the "term" QParser, which was created for the explicit purpose of 
never needing to worry about escaping terms in your index...

	q={!term f=id}2009-11-04:13:51:07.348184



-Hoss

Re: UniqueKey filed length exceeds

Posted by Jamie Johnson <je...@gmail.com>.
It looks like your query is getting parsed as a field and a value

field: 2009-11-04
value: 13:51:07.34814

if you'd like to make a query like this you need to escape the : so
something like

2009-11-04\:13\:51\:07.348184

See the following link for more information

http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Escaping%20Special%20Characters


On Tue, Oct 4, 2011 at 3:59 AM, kiran.bodigam <ki...@gmail.com> wrote:
>  Thanks for u r reply  Erick,
>
> (Here my use case is YYYY-MM-DD 13:54:11.414632 needs to be unique key)
>
> when  i trying to search the data for
> http://localhost:8080/solr/select/?q=2009-11-04:13:51:07.348184
>  it throws following error,
>
> though i change my schema to textfield i am getting following error
>
>  <fieldType name="string" class="solr.TextField" sortMissingLast="true"
> omitNorms="true"  />
>
> kindly check my stack trace
>
> SEVERE: org.apache.solr.common.SolrException: undefined field 2009-11-04
>        at
> org.apache.solr.schema.IndexSchema.getDynamicFieldType(IndexSchema.java:1254)
>        at
> org.apache.solr.schema.IndexSchema$SolrQueryAnalyzer.getAnalyzer(IndexSchema.java:410)
>        at
> org.apache.solr.schema.IndexSchema$SolrIndexAnalyzer.reusableTokenStream(IndexSchema.java:385)
>        at
> org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:574)
>        at
> org.apache.solr.search.SolrQueryParser.getFieldQuery(SolrQueryParser.java:158)
>        at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1421)
>        at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1309)
>        at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1237)
>        at
> org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1226)
>        at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:206)
>        at org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:80)
>        at org.apache.solr.search.QParser.getQuery(QParser.java:142)
>        at
> org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:84)
>        at
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:173)
>        at
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
>        at org.apache.solr.core.SolrCore.execute(SolrCore.java:1360)
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/UniqueKey-filed-length-exceeds-tp3389759p3392432.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: UniqueKey filed length exceeds

Posted by "kiran.bodigam" <ki...@gmail.com>.
 Thanks for u r reply  Erick,

(Here my use case is YYYY-MM-DD 13:54:11.414632 needs to be unique key)

when  i trying to search the data for
http://localhost:8080/solr/select/?q=2009-11-04:13:51:07.348184 
  it throws following error,

though i change my schema to textfield i am getting following error

 <fieldType name="string" class="solr.TextField" sortMissingLast="true"
omitNorms="true"  />

kindly check my stack trace

SEVERE: org.apache.solr.common.SolrException: undefined field 2009-11-04
	at
org.apache.solr.schema.IndexSchema.getDynamicFieldType(IndexSchema.java:1254)
	at
org.apache.solr.schema.IndexSchema$SolrQueryAnalyzer.getAnalyzer(IndexSchema.java:410)
	at
org.apache.solr.schema.IndexSchema$SolrIndexAnalyzer.reusableTokenStream(IndexSchema.java:385)
	at
org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:574)
	at
org.apache.solr.search.SolrQueryParser.getFieldQuery(SolrQueryParser.java:158)
	at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1421)
	at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1309)
	at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1237)
	at
org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1226)
	at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:206)
	at org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:80)
	at org.apache.solr.search.QParser.getQuery(QParser.java:142)
	at
org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:84)
	at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:173)
	at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1360)

--
View this message in context: http://lucene.472066.n3.nabble.com/UniqueKey-filed-length-exceeds-tp3389759p3392432.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: UniqueKey filed length exceeds

Posted by Erick Erickson <er...@gmail.com>.
I really don't understand what you're trying to convey.
Let's see your schema definition for your
unique key. I really wouldn't imagine that fields
of that form *could* be anything except string. It's
not in the correct format for a Solr date, and it's
certainly not a numeric type.....

If that doesn't make sense, please show us the error
(stack trace) you're seeing. But the schema
for the field in question is the important part.

Best
Erick

On Mon, Oct 3, 2011 at 9:28 AM, kiran.bodigam <ki...@gmail.com> wrote:
> I have defined time stamp as unique key but when i trying to search with the
> same it throws error any other alternate for StrField coz i can't increase
> the length of it or can't we apply analyzer for the same?
> My unique key:YYYY-MM-DD 13:54:11.414632
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/UniqueKey-filed-length-exceeds-tp3389759p3389759.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>