Re: What is default Date time format in Solr
Thanks Chris, My index creation was wrong ;)(I was using 12 Hour format) Thanks for your support -kmu On Sat, Mar 8, 2008 at 1:35 AM, Chris Hostetter [EMAIL PROTECTED] wrote: : I heard Solr Date time format is 24 hours. that is correct. : emf.artist:[2007-12-31T22:20:00Z TO 2007-12-31T22:39:00Z] : : I am not able to get the content what I expected. : : But, I tried with following query:- : : emf.artist:[2007-12-31T10:20:00Z TO 2007-12-31T10:39:00Z] Is your emf.artist field stored? If so what value do you see in the field when you do that second query and get the results you are looking for? if they don't match what you think they should be, then the code you have reading dates from your index and writing them to Solr isn't doing what you think it's doing. -Hoss
How to override special meaning of +
Hi , I have following contents in my list:- a) hot+cold b) hot++cold c) hotcold d) hot cold e) cold water f) hot water I want to search only for hot+cold. I tried with hot\+cold and also hot\+cold. I got *first four* contents. How to search only exact match? I have 2 field types, title :- which is supported by dismax. title_exact:- which does not supported by dismax. But only has KeywordTokenizer, and Lowercase. I tried with both fields (title and title_exact, no use :( ). Is it necessary to follow any different mechanism here? Thanks in advance . -kmu
What is default Date time format in Solr
Hi all, I heard Solr Date time format is 24 hours. But I have following query regarding Search time. In database I have a content with time as :- 2007-12-31 22:29:59 In oder to get this content I tried with following Range query:- emf.artist:[2007-12-31T22:20:00Z TO 2007-12-31T22:39:00Z] I am not able to get the content what I expected. But, I tried with following query:- emf.artist:[2007-12-31T10:20:00Z TO 2007-12-31T10:39:00Z] It is perfectly working fine. My Schema.xml content for Date field is like this :- fieldType name=date class=solr.DateField sortMissingLast=true omitNorms=true/ Solrconfig.xml !-- This is an example of using Date Math to specify a constantly moving date range in a config... -- str name=bqincubationdate_dt:[* TO NOW/DAY-1MONTH]^2.2/str Could you please let me know how can I search a content with 24 Hour format? Looking forward hearing from u soon Thanks in advance -kmu
Field Search
Hi, I have a content with *title* as *Advertise* under a *category* *Sales* And also, I have 3 other contents with *titles {TV, Web,Radio}* under a *category Advertise* ** Now, if I try to search for, *title:Advertise --- * I am getting following results: == Title --- Category == Advertise --- Sales TV --- Advertise Radio --- Advertise Web --- Advertise I have given a query such that get me all title which matches *Advertise*. But, it displayed all content which matches advertise(even though title is different) How can I search a content which matches only *advertise* as *title*? Schema.xml defaultSearchFieldtext/defaultSearchField solrQueryParser defaultOperator=OR/ Thanks in advance for your precious time. -kmu
Re: Field Search
Hi, I forgot to put my dismax request handler. requestHandler name=dismax class=solr.DisMaxRequestHandler lst name=defaults str name=echoParamsexplicit/str float name=tie0.01/float str name=qf text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4 /str str name=pf text^0.2 features^1.1 name^1.5 manu^1.4 manu_exact^1.9 /str str name=bf ord(poplarity)^0.5 recip(rord(price),1,1000,1000)^0.3 /str str name=fl id,name,price,score /str str name=mm 2lt;-1 5lt;-2 6lt;90% /str int name=ps100/int str name=q.alt*:*/str /lst /requestHandler Do you think this is causing some issue? -Thanks and Regards, kmu On Feb 19, 2008 6:31 AM, Mahesh Udupa [EMAIL PROTECTED] wrote: Hi, I have a content with *title* as *Advertise* under a *category* *Sales* And also, I have 3 other contents with *titles {TV, Web,Radio}* under a *category Advertise* ** Now, if I try to search for, *title:Advertise --- * I am getting following results: == Title --- Category == Advertise --- Sales TV --- Advertise Radio --- Advertise Web --- Advertise I have given a query such that get me all title which matches *Advertise *. But, it displayed all content which matches advertise(even though title is different) How can I search a content which matches only *advertise* as *title*? Schema.xml defaultSearchFieldtext/defaultSearchField solrQueryParser defaultOperator=OR/ Thanks in advance for your precious time. -kmu
Special character in queries
Hi, I have 2 content with name as follows: a) NewSong sing --- with in the name b) sing I need to search for the content *a* ( i.e. *NewSong sing*), I tried with \NewSong\ sing, It failed to search. But If I try to search with NewSong sing it displays both(that is expected). It would be great if some one please suggest me what is wrong in first query. Thanks in advance. -kmu
Re: Alpha numeric sort problem
Thanks Yonik, I was using example schema.xml, in that alphaOnlySort FieldType contains following analyzer. fieldType name=alphaOnlySort class=solr.TextField sortMissingLast=true omitNorms=true analyzer !-- KeywordTokenizer does no actual tokenizing, so the entire input string is preserved as a single token -- tokenizer class=solr.KeywordTokenizerFactory/ !-- The LowerCase TokenFilter does what you expect, which can be when you want your sorting to be case insensitive -- filter class=solr.LowerCaseFilterFactory / !-- The TrimFilter removes any leading or trailing whitespace -- filter class=solr.TrimFilterFactory / !-- The PatternReplaceFilter gives you the flexibility to use Java Regular expression to replace any sequence of characters matching a pattern with an arbitrary replacement string, which may include back refrences to portions of the orriginal string matched by the pattern. See the Java Regular Expression documentation for more infomation on pattern and replacement string syntax. http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html -- filter class=solr.PatternReplaceFilterFactory pattern=([^a-z]) replacement= replace=all / /analyzer /fieldType Due to last filter class, I could not sort any field other than alphabets. I removed that, it is perfectly working as we expect. Thank you very much for your support. -kmu On Feb 15, 2008 11:49 PM, Yonik Seeley [EMAIL PROTECTED] wrote: On Fri, Feb 15, 2008 at 3:36 AM, Mahesh Udupa [EMAIL PROTECTED] wrote: Thanks Yonik, It works fine. But sort is *case sensitive. * And also, If my String contains some white space(or - or any other special char) then failed to sort, with following error. INFO: /select/ version=2.2rows=20fl=rcid ,status,categoryid,cmprice_value,cmprice_model,cmprice_noofdays,cmprice_nooftimes,cmprice_freqocc,cmprice_startdate,cmprice_enddate,title,devname,category,cmprice,shortdesc,ctype,scorestart=0q=%2Bstatus:published+%2Bplanid:1;title+asc 0 4 Feb 15, 2008 1:40:47 PM org.apache.solr.core.SolrException log SEVERE: java.lang.RuntimeException: there are more terms than documents in field title, but it's impossible to sort on tokenized fields I have used title as follows copyField source=title dest=title_exact/ field name=title_exact type=string indexed=true stored=true/ So how can I make sure that sort is case in-sensitive, works for special chars and numeric fields? Make a custom fieldType, starting with the TextField type and specifying the analyzer to use a keyword tokenizer followed by a lowercase filter. The do the copyField (as you have done above). Then actually sort by the title_exact field (your example query shows you still sorting by title). You probably want to use a separate sort parameter: sort=text_exact desc -Yonik
Re: Alpha numeric sort problem
Thanks Yonik, It works fine. But sort is *case sensitive. * And also, If my String contains some white space(or - or any other special char) then failed to sort, with following error. INFO: /select/ version=2.2rows=20fl=rcid,status,categoryid,cmprice_value,cmprice_model,cmprice_noofdays,cmprice_nooftimes,cmprice_freqocc,cmprice_startdate,cmprice_enddate,title,devname,category,cmprice,shortdesc,ctype,scorestart=0q=%2Bstatus:published+%2Bplanid:1;title+asc 0 4 Feb 15, 2008 1:40:47 PM org.apache.solr.core.SolrException log SEVERE: java.lang.RuntimeException: there are more terms than documents in field title, but it's impossible to sort on tokenized fields I have used title as follows copyField source=title dest=title_exact/ field name=title_exact type=string indexed=true stored=true/ So how can I make sure that sort is case in-sensitive, works for special chars and numeric fields? Sorry again, I am new to Solr. please provide your valid input. Thanks in advance -kmu On Fri, Feb 15, 2008 at 11:08 AM, Yonik Seeley [EMAIL PROTECTED] wrote: On Thu, Feb 14, 2008 at 10:45 PM, Mahesh Udupa [EMAIL PROTECTED] wrote: Even I tried with *text* Field type. But no use. As splitOnCaseChange=1, do we have splitOnLetterToNumberChange or something like that? Sorting requires a single token in the field (you want to sort on the whole value). Try type string. -Yonik
Alpha numeric sort problem
Hello, I have following entry in my title list: Content1 Content2 Content3 Content4 Content5 If I try to Sort it in ascending or descending order, I am getting same order. I am using following alphaOnlySort field and text. Please let me know if I miss anything here. Thanks in advance for looking into this issue. -Thanks and Regards, kmu fieldType name=alphaOnlySort class=solr.TextField sortMissingLast=true omitNorms=true analyzer !-- KeywordTokenizer does no actual tokenizing, so the entire input string is preserved as a single token -- tokenizer class=solr.KeywordTokenizerFactory/ !-- The LowerCase TokenFilter does what you expect, which can be when you want your sorting to be case insensitive -- filter class=solr.LowerCaseFilterFactory / !-- The TrimFilter removes any leading or trailing whitespace -- filter class=solr.TrimFilterFactory / !-- The PatternReplaceFilter gives you the flexibility to use Java Regular expression to replace any sequence of characters matching a pattern with an arbitrary replacement string, which may include back refrences to portions of the orriginal string matched by the pattern. See the Java Regular Expression documentation for more infomation on pattern and replacement string syntax. http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html -- filter class=solr.PatternReplaceFilterFactory pattern=([^a-z]) replacement= replace=all / /analyzer /fieldType fieldType name=text class=solr.TextField positionIncrementGap=100 analyzer type=index tokenizer class=solr.WhitespaceTokenizerFactory/ !-- in this example, we will only use synonyms at query time filter class=solr.SynonymFilterFactory synonyms=index_synonyms.txt ignoreCase=true expand=false/ -- filter class=solr.StopFilterFactory ignoreCase=true words= stopwords.txt/ filter class=solr.WordDelimiterFilterFactory splitOnCaseChange=1 generateWordParts=1 generateNumberParts=0 catenateWords=1 catenateNumbers=0 catenateAll=1/ filter class=solr.LowerCaseFilterFactory/ filter class=solr.EnglishPorterFilterFactory protected= protwords.txt/ filter class=solr.RemoveDuplicatesTokenFilterFactory/ /analyzer analyzer type=query tokenizer class=solr.WhitespaceTokenizerFactory/ filter class=solr.SynonymFilterFactory synonyms=synonyms.txt ignoreCase=true expand=true/ filter class=solr.StopFilterFactory ignoreCase=true words= stopwords.txt/ filter class=solr.WordDelimiterFilterFactory splitOnCaseChange=1 generateWordParts=1 generateNumberParts=0 catenateWords=1 catenateNumbers=0 catenateAll=1/ filter class=solr.LowerCaseFilterFactory/ filter class=solr.EnglishPorterFilterFactory protected= protwords.txt/ filter class=solr.RemoveDuplicatesTokenFilterFactory/ /analyzer /fieldType !-- Less flexible matching, but less false matches. Probably not ideal for product names, but may be good for SKUs. Can insert dashes in the wrong place and still match. -- fieldType name=textTight class=solr.TextField positionIncrementGap=100 analyzer tokenizer class=solr.WhitespaceTokenizerFactory/ filter class=solr.SynonymFilterFactory synonyms=synonyms.txt ignoreCase=true expand=false/ filter class=solr.StopFilterFactory ignoreCase=true words= stopwords.txt/ filter class=solr.WordDelimiterFilterFactory generateWordParts=0 generateNumberParts=0 catenateWords=1 catenateNumbers=1 catenateAll=0/ filter class=solr.LowerCaseFilterFactory/ filter class=solr.EnglishPorterFilterFactory protected= protwords.txt/ filter class=solr.RemoveDuplicatesTokenFilterFactory/ /analyzer /fieldType
Re: Alpha numeric sort problem
Thanks Erick for your quick response. Even I tried with *text* Field type. But no use. As splitOnCaseChange=1, do we have splitOnLetterToNumberChange or something like that? Thanks in advance kmu On Thu, Feb 14, 2008 at 9:50 PM, Erick Erickson [EMAIL PROTECTED] wrote: I admit I know little about SOLR, but wouldn't an AlphaOnlySorter ignore the digits? Erick On Thu, Feb 14, 2008 at 3:51 AM, Mahesh Udupa [EMAIL PROTECTED] wrote: Hello, I have following entry in my title list: Content1 Content2 Content3 Content4 Content5 If I try to Sort it in ascending or descending order, I am getting same order. I am using following alphaOnlySort field and text. Please let me know if I miss anything here. Thanks in advance for looking into this issue. -Thanks and Regards, kmu fieldType name=alphaOnlySort class=solr.TextField sortMissingLast=true omitNorms=true analyzer !-- KeywordTokenizer does no actual tokenizing, so the entire input string is preserved as a single token -- tokenizer class=solr.KeywordTokenizerFactory/ !-- The LowerCase TokenFilter does what you expect, which can be when you want your sorting to be case insensitive -- filter class=solr.LowerCaseFilterFactory / !-- The TrimFilter removes any leading or trailing whitespace -- filter class=solr.TrimFilterFactory / !-- The PatternReplaceFilter gives you the flexibility to use Java Regular expression to replace any sequence of characters matching a pattern with an arbitrary replacement string, which may include back refrences to portions of the orriginal string matched by the pattern. See the Java Regular Expression documentation for more infomation on pattern and replacement string syntax. http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/package-summary.html -- filter class=solr.PatternReplaceFilterFactory pattern=([^a-z]) replacement= replace=all / /analyzer /fieldType fieldType name=text class=solr.TextField positionIncrementGap=100 analyzer type=index tokenizer class=solr.WhitespaceTokenizerFactory/ !-- in this example, we will only use synonyms at query time filter class=solr.SynonymFilterFactory synonyms=index_synonyms.txt ignoreCase=true expand=false/ -- filter class=solr.StopFilterFactory ignoreCase=true words= stopwords.txt/ filter class=solr.WordDelimiterFilterFactory splitOnCaseChange=1 generateWordParts=1 generateNumberParts=0 catenateWords=1 catenateNumbers=0 catenateAll=1/ filter class=solr.LowerCaseFilterFactory/ filter class=solr.EnglishPorterFilterFactory protected= protwords.txt/ filter class=solr.RemoveDuplicatesTokenFilterFactory/ /analyzer analyzer type=query tokenizer class=solr.WhitespaceTokenizerFactory/ filter class=solr.SynonymFilterFactory synonyms=synonyms.txt ignoreCase=true expand=true/ filter class=solr.StopFilterFactory ignoreCase=true words= stopwords.txt/ filter class=solr.WordDelimiterFilterFactory splitOnCaseChange=1 generateWordParts=1 generateNumberParts=0 catenateWords=1 catenateNumbers=0 catenateAll=1/ filter class=solr.LowerCaseFilterFactory/ filter class=solr.EnglishPorterFilterFactory protected= protwords.txt/ filter class=solr.RemoveDuplicatesTokenFilterFactory/ /analyzer /fieldType !-- Less flexible matching, but less false matches. Probably not ideal for product names, but may be good for SKUs. Can insert dashes in the wrong place and still match. -- fieldType name=textTight class=solr.TextField positionIncrementGap=100 analyzer tokenizer class=solr.WhitespaceTokenizerFactory/ filter class=solr.SynonymFilterFactory synonyms=synonyms.txt ignoreCase=true expand=false/ filter class=solr.StopFilterFactory ignoreCase=true words= stopwords.txt/ filter class=solr.WordDelimiterFilterFactory generateWordParts=0 generateNumberParts=0 catenateWords=1 catenateNumbers=1 catenateAll=0/ filter class=solr.LowerCaseFilterFactory/ filter class=solr.EnglishPorterFilterFactory protected= protwords.txt/ filter class=solr.RemoveDuplicatesTokenFilterFactory/ /analyzer /fieldType