Re: how to use PHP AND PHPS?
What are the results of the two var_dumps? dave On Nov 5, 2007, at 10:06 PM, James liu wrote: first: i m sure i enable php and phps in my solrconfig.xml two: i can't get answer. *phps: *?php $url = ' http://localhost:8080/solr1/select/? q=2version=2.2start=0rows=10indent=onwt=phps '; $a = file_get_contents($url); echo 'before unserializebr/'; var_dump($a); $a = unserialize($a); echo 'after unserialize...br/'; var_dump($a); ?* * On 11/6/07, Stu Hood [EMAIL PROTECTED] wrote: Did you enable the PHP serialized response writer in your solrconfig.xml? It is not enabled by default. Thanks, Stu -Original Message- From: James liu [EMAIL PROTECTED] Sent: Monday, November 5, 2007 9:03am To: solr-user@lucene.apache.org Subject: Re: how to use PHP AND PHPS? i know it...but u try it,,u will find simlar question. On 11/5/07, Robert Young [EMAIL PROTECTED] wrote: I would imagine you have to unserialize On 11/5/07, James liu [EMAIL PROTECTED] wrote: i find they all return string ?php $url = ' http://localhost:8080/solr/select/? q=solrversion=2.2start=0rows=10indent=onwt=php '; var_dump(file_get_contents($url); ? -- regards jl -- regards jl -- regards jl
query syntax
Hi I have in index document with field name and its value is somename123 Why I can't find anything with query name:somename123* but there are results on query name:somename123* As far as I understand first query is just fine. why Solr didn't understand it? I'm using StandardRequestHandler thank you -- Best regards, Traut
Re: query syntax
On 11/6/07, Traut [EMAIL PROTECTED] wrote: I have in index document with field name and its value is somename123 Why I can't find anything with query name:somename123* This is a prefix query. No analysis is done on the prefix, so it may not match analysis that was done when the document was indexed. For example, if you use WordDelimiterFilter, this may be indexed as somename 123 but there are results on query name:somename123* This is not a prefix query. The * will most likely be removed by the analyzer, leaving you effectively with a query of name:somename123 -Yonik
Re: query syntax
So you think my problem is caused by different index/query data analysis? i'll check it. thank you On Nov 6, 2007 6:02 PM, Yonik Seeley [EMAIL PROTECTED] wrote: On 11/6/07, Traut [EMAIL PROTECTED] wrote: I have in index document with field name and its value is somename123 Why I can't find anything with query name:somename123* This is a prefix query. No analysis is done on the prefix, so it may not match analysis that was done when the document was indexed. For example, if you use WordDelimiterFilter, this may be indexed as somename 123 but there are results on query name:somename123* This is not a prefix query. The * will most likely be removed by the analyzer, leaving you effectively with a query of name:somename123 -Yonik -- Best regards, Traut
escaping characters and security
Are there any security risks to passing a query directly to Solr without doing any sort of escaping? I am using URL encoding, so '' and such are being encoded into their %XX equivalents. Still, should I be doing anything else? Is there such a thing as a Solr-injection attack? Thanks, Micah
Re: escaping characters and security
On Tue, 2007-11-06 at 11:52 -0500, Micah Wedemeyer wrote: Are there any security risks to passing a query directly to Solr without doing any sort of escaping? I am using URL encoding, so '' and such are being encoded into their %XX equivalents. Still, should I be doing anything else? Is there such a thing as a Solr-injection attack? http://wiki.apache.org/solr/mySolr Typically it's not recommended do have your front end users/clients hitting Solr directly as part of an HTML form submit ... the more conventional way to think of it is that Solr is a backend service, which your application can talk to over HTTP -- if you were dealing with a database, you wouldn't expect that you could generate an HTML form for your clients and then have them submit that form in some way that resulted in their browser using JDBC (or ODBC) to communicate directly with your database, their client would communicate with your App, which would validate their input, impose some security checks on the input, and then execute the underlying query to your database -- working with Solr should be very similar, it just so happens that instead of using JDBC or some other binary protocol, Solr uses HTTP, and you *can* talk to it directly from a web browser, but that's really more of a debugging feature then anything else. HTH salu2 Thanks, Micah -- Thorsten Scherler thorsten.at.apache.org Open Source Java consulting, training and solutions
Re: escaping characters and security
Solr queries can't do updates, so passing on raw user queries is OK. Solr errors for bad query syntax are not pretty, so you will want to catch those and print a real error message. wunder On 11/6/07 8:52 AM, Micah Wedemeyer [EMAIL PROTECTED] wrote: Are there any security risks to passing a query directly to Solr without doing any sort of escaping? I am using URL encoding, so '' and such are being encoded into their %XX equivalents. Still, should I be doing anything else? Is there such a thing as a Solr-injection attack? Thanks, Micah
Facets queries are not caching
I can't figure out why running the same query twice in a row using facets takes the same amount of time: INFO: /select facet=truefl=pk_i,scorefacet.mincount=1q=(510)+AND+type_t:Candidatefacet.limit=-1facet.field=company_facetqt=standardwt=ruby 0 6670 Nov 6, 2007 12:54:59 PM org.apache.solr.core.SolrCore execute INFO: /select facet=truefl=pk_i,scorefacet.mincount=1q=(510)+AND+type_t:Candidatefacet.limit=-1facet.field=company_facetqt=standardwt=ruby 0 6659 If I disable facets, the query is instantaneous. Based on my simplistic reading of SimpleFacets.java, the calls to numDocs should be placing things in the filter cache, no? More generally, does anyone have any pointers about further avenues for optimization? Our index is fairly large (~6 million records) and I'm trying to gin up ways to make the facets portion run faster. Most of the suggestions I have seen revolve around computing the intersections of cached BitSets. But, again, it seems like functionality is now in Solr core since all calls from SimpleFacets to SolrIndexSearch are cache-aware. One nice feature of our database is that it changes very infrequently, so there is a lot of opportunity for precomputing, I just need to think of the best way to do it. If anyone has any experience here I'd also be grateful. Thanks for any help! -- Jonathan [EMAIL PROTECTED]
Re: Facets queries are not caching
On 6-Nov-07, at 11:08 AM, Jonathan ter Horst wrote: I can't figure out why running the same query twice in a row using facets takes the same amount of time: INFO: /select facet=truefl=pk_i,scorefacet.mincount=1q=(510)+AND +type_t:Candidatefacet.limit=-1facet.field=company_facetqt=standar dwt=ruby 0 6670 Nov 6, 2007 12:54:59 PM org.apache.solr.core.SolrCore execute INFO: /select facet=truefl=pk_i,scorefacet.mincount=1q=(510)+AND +type_t:Candidatefacet.limit=-1facet.field=company_facetqt=standar dwt=ruby 0 6659 If I disable facets, the query is instantaneous. Based on my simplistic reading of SimpleFacets.java, the calls to numDocs should be placing things in the filter cache, no? It does. Are you sure that the filter cache wasn't already warmed, and if not, that it is large enough to house the # of unique values you are faceting on? Check the cache statistics on the admin gui. Are there large numbers of evictions? Alternatively, is company_facet multi- or -single-valued? If the latter, the filter cache is not used at all. -Mike More generally, does anyone have any pointers about further avenues for optimization? Our index is fairly large (~6 million records) and I'm trying to gin up ways to make the facets portion run faster. Most of the suggestions I have seen revolve around computing the intersections of cached BitSets. But, again, it seems like functionality is now in Solr core since all calls from SimpleFacets to SolrIndexSearch are cache-aware. One nice feature of our database is that it changes very infrequently, so there is a lot of opportunity for precomputing, I just need to think of the best way to do it. If anyone has any experience here I'd also be grateful. Thanks for any help! -- Jonathan [EMAIL PROTECTED]
RE: Score of exact matches
What is the performance profile of this against merely searching against one field? My situation is millions of small records with an average of 200 bytes/text field. Lance -Original Message- From: Walter Underwood [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 9:38 PM To: solr-user@lucene.apache.org Subject: Re: Score of exact matches This is fairly straightforward and works well with the DisMax handler. Indes the text into three different fields with three different sets of analyzers. Use something like this in the request handler: requestHandler name=multimatch class=solr.DisMaxRequestHandler lst name=defaults float name=tie0.01/float str name=qf exact^16 noaccent^4 stemmed /str str name=pf exact^16 noaccent^4 stemmed /str /lst /requestHandler You will probably need to adjust the weights for your content, though I expect these are a good starting place. Per-field analyzers are very easy to use in Solr and are extremely powerful. I wish we'd thought of that in Ultraseek. wunder == Search Guy, Netflix Formerly: Architect, Ultraseek On 11/5/07 9:05 PM, Papalagi Pakeha [EMAIL PROTECTED] wrote: Hi all, I use Solr 1.2 on a job advertising site. I started from the default setup that runs all documents and queries through EnglishPorterFilterFactory. As a result for example an ad with accounts in its title is matched when someone runs a query for accountant because both are stemmed to the account word and then they match. Is it somehow possible to give a higher score to exact matches and sort them before matches from stemmed terms? Close to this is a problem with accents - I can remove accents from both documents and from queries and then run the query on non-accented terms. But I'd like to give higher score to documents where the search term matches exactly (i.e. including accents and possibly letter capitalization, etc) and sort them before more fuzzy searches. To me it looks like I have to run multiple sub-queries for each query, one for exact match, one for accents removed and one for stemmed words and then combine the results and compute the final score for each match. Is that possible? Thanks! PaPa
Re: Using Embedded and HTTP Post alternatively
On 6-Nov-07, at 10:52 AM, Jörg Kiegeland wrote: If you need to allow HTTP access to solr, then just use standard solr with your embedded stuff in a custom request handler (or something). Any other path, you will be re-inventing many wheels. If at all possible, I reccomend checking out: http://wiki.apache.org/solr/Solrj this is nice because you can write the same code and use it in an embedded context or with an HTTP server depending on the needs (or if the needs change) As I see, the SolrServer interface (and Solrj in general) only is shiped with version 1.3. Is there any date when Solr 1.3 is published? No planned date, but I wouldn't expect it to be _too_ long. It would be nice to coincide with Lucene 2.3. How reliable are the nightly builds? Can it be used in production? I think it is quite reliable, but there are bound to be a few quirks that haven't been discovered yet. I'm using it in production. More important than any claims we make is running it against your own application's test suite, of course. -Mike
RE: Can you parse the contents of a field to populate other fields?
Yonik - thanks so much for your help! Just to clarify; where should the regex go for each field? Thanks! Kristen Kristen Roth Associate Software Engineer P 617.218.6661 F 617.218.6861 E [EMAIL PROTECTED] Molecular 343 Arsenal Street Watertown, MA 02472 www.Molecular.com Linked by Isobar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Yonik Seeley Sent: Monday, November 05, 2007 4:52 PM To: solr-user@lucene.apache.org Subject: Re: Can you parse the contents of a field to populate other fields? On 11/5/07, Kristen Roth [EMAIL PROTECTED] wrote: I'm wondering if this is possible... I am trying to model a hierarchy of facets, and have a field in my xml (Category) that structured like this: facet1::facet2::facet3... At index time, I would like to split this field on the :: to populate several other fields I have defined in my schema (Category_1, Category_2, Category_3). Is this possible? If so, what is the best way to do this? I think a PatternTokenizer might be able to do this... set up a copyField from Category to all the other category fields, and then set up a different regex on each field to pull out the right part. -Yonik
Re: escaping characters and security
Thanks. That's what I wanted to know. Micah Walter Underwood wrote: Also, this page has a list of special characters that you may want to escape: http://lucene.apache.org/java/docs/queryparsersyntax.html wunder On 11/6/07 9:15 AM, Walter Underwood [EMAIL PROTECTED] wrote: Solr queries can't do updates, so passing on raw user queries is OK. Solr errors for bad query syntax are not pretty, so you will want to catch those and print a real error message. wunder On 11/6/07 8:52 AM, Micah Wedemeyer [EMAIL PROTECTED] wrote: Are there any security risks to passing a query directly to Solr without doing any sort of escaping? I am using URL encoding, so '' and such are being encoded into their %XX equivalents. Still, should I be doing anything else? Is there such a thing as a Solr-injection attack? Thanks, Micah
Re: Tomcat JNDI Settings
Hi Chris, Thanks for getting back to me. The folder /var/lib/tomcat5/solr/home exists as does /var/lib/tomcat5/solr/home/conf/solrconfig.xml. It's basically a copy of the files from examples folder at this point. I put war files in /var/lib/tomcat5/webapps, so I have the apache-solr-1.2.0.war file outside of the webapps folder. Are there any special permissions these files need? I have them owned by the tomcat user. Wayne Chris Hostetter wrote: : Context docBase=/var/lib/tomcat5/solr/apache-solr-1.2.0.war debug=0 : crossContext=true :Environment name=solr/home type=java.lang.String : value=/var/lib/tomcat5/solr/home override=true / : /Context : SEVERE: Exception starting filter SolrRequestFilter class : java.lang.NoClassDefFoundError: Could not initialize class : org.apache.solr.core.SolrConfig this may be a variant of SOLR-337 ... are you sure /var/lib/tomcat5/solr/home exists? does it contain a ./conf directory? does the conf directory contain a solrconfig.xml file? https://issues.apache.org/jira/browse/SOLR-337 Second suggestion: is /var/lib/tomcat5/ the directory where you normally put war files for tomcat? i recall people saying that with tomcat, if you want to use a context file then the war *must* not be in the nromal webaps directory... http://wiki.apache.org/solr/SolrTomcat#head-7036378fa48b79c0797cc8230a8aa0965412fb2e For Tomcat 5.5 and later, the war file must be stored outside of the webapps directory for this to work. Otherwise, this Context element is ignored. -Hoss -- /** * Wayne Graham * Earl Gregg Swem Library * PO Box 8794 * Williamsburg, VA 23188 * 757.221.3112 * http://swem.wm.edu/blogs/waynegraham/ */
uniqueKey type
We used a custom fieldType that segments the values of a field A into tokens. We then define uniqueKey as that field A. It seems when we update a document by solr, documents that have different values (one contains the other as a substring) gets collided into one so the result is the new document removed the old one. Does uniqueKey field has to be string typed? How does the comparison of the values work for updating documents? thanks, -Hui
Re: uniqueKey type
On 6-Nov-07, at 2:31 PM, Yu-Hui Jin wrote: We used a custom fieldType that segments the values of a field A into tokens. We then define uniqueKey as that field A. It seems when we update a document by solr, documents that have different values (one contains the other as a substring) gets collided into one so the result is the new document removed the old one. Does uniqueKey field has to be string typed? How does the comparison of the values work for updating documents? uniqueKey needn't be string type, but the tokenizer must produce a single token only (and any documents that have the same resulting token will be considered the same). If this is violated, the behaviour is undefined (but I wouldn't be surprised if the first token was used). -Mike
Re: uniqueKey type
Got it. Thanks, Mike. That explains. regards, -Hui On 11/6/07, Mike Klaas [EMAIL PROTECTED] wrote: On 6-Nov-07, at 2:31 PM, Yu-Hui Jin wrote: We used a custom fieldType that segments the values of a field A into tokens. We then define uniqueKey as that field A. It seems when we update a document by solr, documents that have different values (one contains the other as a substring) gets collided into one so the result is the new document removed the old one. Does uniqueKey field has to be string typed? How does the comparison of the values work for updating documents? uniqueKey needn't be string type, but the tokenizer must produce a single token only (and any documents that have the same resulting token will be considered the same). If this is violated, the behaviour is undefined (but I wouldn't be surprised if the first token was used). -Mike -- Regards, -Hui
Re: Using Embedded and HTTP Post alternatively
How reliable are the nightly builds? Can it be used in production? The nightly builds are stable in that they do what they say they do -- and if not, they are fixed quickly. However, the interfaces that have changed since 1.2 are not totally stable. That is, the interfaces from 1.2 will work in 1.3, but new things (including solrj) are subject to change until the official release. ryan
Re: Where to set result limit using SolrServer interface?
Jörg Kiegeland wrote: I have a query SolrServer server = getSolrServer(); SolrQuery solrQuery = new SolrQuery(); solrQuery.setQuery(..); QueryResponse rsp = server.query(solrQuery); Now where can I set the result limit for this query? solrQuery.setRows( # ) To see the javadocs, download a nightly from: http://lucene.zones.apache.org:8080/hudson/job/Solr-Nightly/ and it will be in: /docs/api-solrj/ I just realized that these are not on-line like: http://lucene.zones.apache.org:8080/hudson/job/Solr-Nightly/javadoc/ I'll look into getting that up. Another question : Where can I download the test cases for Solrj mentioned in the Solr 1.3 wiki? They are included in the nightly builds or directly from svn: http://svn.apache.org/repos/asf/lucene/solr/trunk/client/java/solrj/test/ - - - - also, when you post messages to the mailing list, start a new thread when you ask about a new topic. See hoss' note: http://people.apache.org/~hossman/#threadhijack ryan
Re: how to use PHP AND PHPS?
first var_dump result(part not all): string(50506) a:2:{s:14:responseHeader;a:3:{s:6:status;i:0;s:5:QTime;i:2906;s:6:params;a:6:{s:6:indent;s:2:on;s:5:start;s:1:0;s:1:q;s:1:2;s:2:wt;s:4:phps;s:4:rows;s:2:10;s:7:version;s:3: 2.2;}} two var_dump result: bool(false) On Nov 6, 2007 10:36 PM, Dave Lewis [EMAIL PROTECTED] wrote: What are the results of the two var_dumps? dave On Nov 5, 2007, at 10:06 PM, James liu wrote: first: i m sure i enable php and phps in my solrconfig.xml two: i can't get answer. *phps: *?php $url = ' http://localhost:8080/solr1/select/? q=2version=2.2start=0rows=10indent=onwt=phps '; $a = file_get_contents($url); echo 'before unserializebr/'; var_dump($a); $a = unserialize($a); echo 'after unserialize...br/'; var_dump($a); ?* * On 11/6/07, Stu Hood [EMAIL PROTECTED] wrote: Did you enable the PHP serialized response writer in your solrconfig.xml? It is not enabled by default. Thanks, Stu -Original Message- From: James liu [EMAIL PROTECTED] Sent: Monday, November 5, 2007 9:03am To: solr-user@lucene.apache.org Subject: Re: how to use PHP AND PHPS? i know it...but u try it,,u will find simlar question. On 11/5/07, Robert Young [EMAIL PROTECTED] wrote: I would imagine you have to unserialize On 11/5/07, James liu [EMAIL PROTECTED] wrote: i find they all return string ?php $url = ' http://localhost:8080/solr/select/? q=solrversion=2.2start=0rows=10indent=onwt=php '; var_dump(file_get_contents($url); ? -- regards jl -- regards jl -- regards jl -- regards jl
Sorting problem
Hi UG, I just installed the latest nightly solr build (1.2.2007.11.06.08.06.05). I get an exception when I do descending relevancy sorting. Ascending relevancy sorting works fine and sorting on all other fields as well. http://localhost:8080/solr/select/?q=title%3Atestsort=score%20desc Nov 7, 2007 1:13:36 AM org.apache.solr.common.SolrException log SEVERE: java.lang.NullPointerException at org.apache.solr.search.QParser.getSort(QParser.java:158) at org.apache.solr.search.OldLuceneQParser.getSort(LuceneQParserPlugin.java:124) at org.apache.solr.handler.StandardRequestHandler.handleRequestBody(StandardRequestHandler.java:85) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:117) at org.apache.solr.core.SolrCore.execute(SolrCore.java:811) at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:206) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:174) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445) at java.lang.Thread.run(Thread.java:595) Nov 7, 2007 1:13:36 AM org.apache.solr.core.SolrCore execute INFO: /select/ sort=score+descq=title:test 0 2 Nov 7, 2007 1:13:36 AM org.apache.solr.common.SolrException log SEVERE: java.lang.NullPointerException at org.apache.solr.search.QParser.getSort(QParser.java:158) at org.apache.solr.search.OldLuceneQParser.getSort(LuceneQParserPlugin.java:124) at org.apache.solr.handler.StandardRequestHandler.handleRequestBody(StandardRequestHandler.java:85) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:117) at org.apache.solr.core.SolrCore.execute(SolrCore.java:811) at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:206) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:174) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445) at java.lang.Thread.run(Thread.java:595) http://localhost:8080/solr/select/?q=title%3Atestsort=score%20asc Nov 7, 2007 1:13:42 AM org.apache.solr.core.SolrCore execute INFO: /select/ sort=score+ascq=title:test 0 17 Does anyone know what could be the problem? Thanks, Michael -- Michael Thessel [EMAIL PROTECTED] Gossamer Threads Inc. http://www.gossamer-threads.com/ Tel: (604) 687-5804 Fax: (604) 687-5806
Re: how to use PHP AND PHPS?
On Nov 6, 2007, at 8:10 PM, James liu wrote: first var_dump result(part not all): string(50506) a:2:{s:14:responseHeader;a:3:{s:6:status;i:0;s:5:QTime;i: 2906;s:6:params;a:6:{s:6:indent;s:2:on;s:5:start;s:1:0;s: 1:q;s:1:2;s:2:wt;s:4:phps;s:4:rows;s:2:10;s: 7:version;s:3: 2.2;}} This is exactly correct. two var_dump result: bool(false) So, unserializing is failing. Are you running from the trunk or from a nightly? There was a bug a couple of weeks ago that sent back faulty serialized data. It's fixed now. It's possible this is your issue. dave On Nov 6, 2007 10:36 PM, Dave Lewis [EMAIL PROTECTED] wrote: What are the results of the two var_dumps? dave On Nov 5, 2007, at 10:06 PM, James liu wrote: first: i m sure i enable php and phps in my solrconfig.xml two: i can't get answer. *phps: *?php $url = ' http://localhost:8080/solr1/select/? q=2version=2.2start=0rows=10indent=onwt=phps '; $a = file_get_contents($url); echo 'before unserializebr/'; var_dump($a); $a = unserialize($a); echo 'after unserialize...br/'; var_dump($a); ?* * On 11/6/07, Stu Hood [EMAIL PROTECTED] wrote: Did you enable the PHP serialized response writer in your solrconfig.xml? It is not enabled by default. Thanks, Stu -Original Message- From: James liu [EMAIL PROTECTED] Sent: Monday, November 5, 2007 9:03am To: solr-user@lucene.apache.org Subject: Re: how to use PHP AND PHPS? i know it...but u try it,,u will find simlar question. On 11/5/07, Robert Young [EMAIL PROTECTED] wrote: I would imagine you have to unserialize On 11/5/07, James liu [EMAIL PROTECTED] wrote: i find they all return string ?php $url = ' http://localhost:8080/solr/select/? q=solrversion=2.2start=0rows=10indent=onwt=php '; var_dump(file_get_contents($url); ? -- regards jl -- regards jl -- regards jl -- regards jl
Re: how to use PHP AND PHPS?
afternoon,,i will update svn...and try the newest... On Nov 7, 2007 11:23 AM, Dave Lewis [EMAIL PROTECTED] wrote: On Nov 6, 2007, at 8:10 PM, James liu wrote: first var_dump result(part not all): string(50506) a:2:{s:14:responseHeader;a:3:{s:6:status;i:0;s:5:QTime;i: 2906;s:6:params;a:6:{s:6:indent;s:2:on;s:5:start;s:1:0;s: 1:q;s:1:2;s:2:wt;s:4:phps;s:4:rows;s:2:10;s: 7:version;s:3: 2.2;}} This is exactly correct. two var_dump result: bool(false) So, unserializing is failing. Are you running from the trunk or from a nightly? There was a bug a couple of weeks ago that sent back faulty serialized data. It's fixed now. It's possible this is your issue. dave On Nov 6, 2007 10:36 PM, Dave Lewis [EMAIL PROTECTED] wrote: What are the results of the two var_dumps? dave On Nov 5, 2007, at 10:06 PM, James liu wrote: first: i m sure i enable php and phps in my solrconfig.xml two: i can't get answer. *phps: *?php $url = ' http://localhost:8080/solr1/select/? q=2version=2.2start=0rows=10indent=onwt=phps '; $a = file_get_contents($url); echo 'before unserializebr/'; var_dump($a); $a = unserialize($a); echo 'after unserialize...br/'; var_dump($a); ?* * On 11/6/07, Stu Hood [EMAIL PROTECTED] wrote: Did you enable the PHP serialized response writer in your solrconfig.xml? It is not enabled by default. Thanks, Stu -Original Message- From: James liu [EMAIL PROTECTED] Sent: Monday, November 5, 2007 9:03am To: solr-user@lucene.apache.org Subject: Re: how to use PHP AND PHPS? i know it...but u try it,,u will find simlar question. On 11/5/07, Robert Young [EMAIL PROTECTED] wrote: I would imagine you have to unserialize On 11/5/07, James liu [EMAIL PROTECTED] wrote: i find they all return string ?php $url = ' http://localhost:8080/solr/select/? q=solrversion=2.2start=0rows=10indent=onwt=php '; var_dump(file_get_contents($url); ? -- regards jl -- regards jl -- regards jl -- regards jl -- regards jl
SOLR 1.2 - Duplicate Documents??
Hey all, I have a fairly odd case of duplicate documents in our solr index (See attached xml sample). THe index is roughtly 35k in documents. The only way I've found to fix the problem is to run a delete statement by id, which deletes both, I can then re-index that one document. This happened previosuly but it ended up being an issue with case-sensitivity but this time the id's appear identical! Any assistance in tracking this down would be appeciated! I can provide any other logs if nesseary. Thanks, Dan Sample Select Query: ?xml version=1.0 encoding=UTF-8 ? - response - lst name=responseHeader int name=status0/int int name=QTime0/int /lst - result name=response numFound=2 start=0 - doc - arr name=categoryId int151/int int962/int int1493/int int1830/int /arr - arr name=finish strN/A/str /arr bool name=hasDigiCastfalse/bool bool name=hasDigiVistafalse/bool str name=idhr-802waclighting/str - arr name=inStock boolfalse/bool /arr bool name=isNewfalse/bool bool name=isTopSellertrue/bool str name=manufacturerwac lighting/str - arr name=masterFinish strnot applicable/str /arr date name=modifiedDate2007-10-15T23:10:01.510Z/date bool name=onSalefalse/bool int name=popularity1683/int - arr name=price float53.91/float /arr date name=productAddDate2007-07-05T00:00:00Z/date str name=productIDHR-802/str str name=productTitleLow Voltage Miniature Housing for Recessed Lighting Fixture/str str name=serieslow voltage miniature housings/str - arr name=sku str / /arr str name=theme / - arr name=upc str / /arr /doc - doc - arr name=categoryId int151/int int962/int int1493/int int1830/int /arr - arr name=finish strN/A/str /arr bool name=hasDigiCastfalse/bool bool name=hasDigiVistafalse/bool str name=idhr-802waclighting/str - arr name=inStock boolfalse/bool /arr bool name=isNewfalse/bool bool name=isTopSellertrue/bool str name=manufacturerwac lighting/str - arr name=masterFinish strnot applicable/str /arr date name=modifiedDate2007-11-02T15:33:21.154Z/date bool name=onSalefalse/bool int name=popularity1683/int - arr name=price float53.91/float /arr date name=productAddDate2007-07-05T00:00:00Z/date str name=productIDHR-802/str str name=productTitleLow Voltage Miniature Housing for Recessed Lighting Fixture/str str name=serieslow voltage miniature housings/str - arr name=sku str / /arr str name=theme / - arr name=upc str / /arr /doc /result /response Schema.xml field name=id type=string indexed=true stored=true/ field name=sku type=textTight indexed=true stored=true multiValued=true/ field name=upc type=textTight indexed=true stored=true multiValued=true/ . !-- field to use to determine and enforce document uniqueness. -- uniqueKeyid/uniqueKey !-- field for the QueryParser to use when an explicit fieldname is absent -- defaultSearchFieldtext/defaultSearchField !-- SolrQueryParser configuration: defaultOperator=AND|OR -- solrQueryParser defaultOperator=OR/ -- View this message in context: http://www.nabble.com/SOLR-1.2---Duplicate-Documents---tf4762687.html#a13621332 Sent from the Solr - User mailing list archive at Nabble.com.
Re: Tomcat JNDI Settings
: Thanks for getting back to me. The folder /var/lib/tomcat5/solr/home : exists as does /var/lib/tomcat5/solr/home/conf/solrconfig.xml. It's : basically a copy of the files from examples folder at this point. : : I put war files in /var/lib/tomcat5/webapps, so I have the : apache-solr-1.2.0.war file outside of the webapps folder. : : Are there any special permissions these files need? I have them owned by : the tomcat user. that should be fine ... is /var/lib/tomcat5/solr/home/ writable by the tomcat user so it can make the ./data and ./data/index directories? are you sure there aren't any other errors in the logs above the one you mentioned already? -Hoss
Re: how to use PHP AND PHPS?
same answer. On Nov 7, 2007 11:41 AM, James liu [EMAIL PROTECTED] wrote: afternoon,,i will update svn...and try the newest... On Nov 7, 2007 11:23 AM, Dave Lewis [EMAIL PROTECTED] wrote: On Nov 6, 2007, at 8:10 PM, James liu wrote: first var_dump result(part not all): string(50506) a:2:{s:14:responseHeader;a:3:{s:6:status;i:0;s:5:QTime;i: 2906;s:6:params;a:6:{s:6:indent;s:2:on;s:5:start;s:1:0;s: 1:q;s:1:2;s:2:wt;s:4:phps;s:4:rows;s:2:10;s: 7:version;s:3: 2.2;}} This is exactly correct. two var_dump result: bool(false) So, unserializing is failing. Are you running from the trunk or from a nightly? There was a bug a couple of weeks ago that sent back faulty serialized data. It's fixed now. It's possible this is your issue. dave On Nov 6, 2007 10:36 PM, Dave Lewis [EMAIL PROTECTED] wrote: What are the results of the two var_dumps? dave On Nov 5, 2007, at 10:06 PM, James liu wrote: first: i m sure i enable php and phps in my solrconfig.xml two: i can't get answer. *phps: *?php $url = ' http://localhost:8080/solr1/select/? q=2version= 2.2start=0rows=10indent=onwt=phps '; $a = file_get_contents($url); echo 'before unserializebr/'; var_dump($a); $a = unserialize($a); echo 'after unserialize...br/'; var_dump($a); ?* * On 11/6/07, Stu Hood [EMAIL PROTECTED] wrote: Did you enable the PHP serialized response writer in your solrconfig.xml? It is not enabled by default. Thanks, Stu -Original Message- From: James liu [EMAIL PROTECTED] Sent: Monday, November 5, 2007 9:03am To: solr-user@lucene.apache.org Subject: Re: how to use PHP AND PHPS? i know it...but u try it,,u will find simlar question. On 11/5/07, Robert Young [EMAIL PROTECTED] wrote: I would imagine you have to unserialize On 11/5/07, James liu [EMAIL PROTECTED] wrote: i find they all return string ?php $url = ' http://localhost:8080/solr/select/? q=solrversion=2.2start=0rows=10indent=onwt=php '; var_dump(file_get_contents($url); ? -- regards jl -- regards jl -- regards jl -- regards jl -- regards jl -- regards jl
Re: how to use PHP AND PHPS?
i just decrease answer information...and u will see my result(full, not part) *before unserialize* string(433) a:2:{s:14:responseHeader;a:3:{s:6:status;i:0;s:5:QTime;i:0;s:6:params;a:7:{s:2:fl;s:5:Title;s:6:indent;s:2:on;s:5:start;s:1:0;s:1:q;s:1:2;s:2:wt;s:4:phps;s:4:rows;a:2:{i:0;s:1:2;i:1;s:2:10;}s:7:version;s:3: 2.2;}}s:8:response;a:3:{s:8:numFound;i:28;s:5:start;i:0;s:4:docs;a:2:{i:0;a:1:{s:5:Title;d:诺基亚N-Gage基本数据;}i:1;a:1:{s:5:Title;d:索尼爱立信P908基本数据; *after unserialize...* bool(false) and i write serialize test code.. ?php $ar = array ( array('id' = 123, 'Title'= 中文测试), array('id' = 123, 'Title'= 中国上海), ); echo serialize($ar); ? and result is : a:2:{i:0;a:2:{s:2:id;i:123;s:5:Title;s:12:中文测试;}i:1;a:2:{s:2:id;i:123;s:5:Title;s:12:中国上海;}} *php* result is: string(369) array( 'responseHeader'=array( 'status'=0, 'QTime'=0, 'params'=array( 'fl'='Title', 'indent'='on', 'start'='0', 'q'='2', 'wt'='php', 'rows'=array('2', '10'), 'version'='2.2')), 'response'=array('numFound'=28,'start'=0,'docs'=array( array( 'Title'=诺基亚N-Gage基本数据), array( 'Title'=索尼爱立信P908基本数据)) )) it is string, so i can't read it correctly by php. -- regards jl