Re: Multiple boost queries on a specific field
Hello Chris, This totally does the trick. I drastically improved relevancy. Thank you much for your advices ! - Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Multiple-boost-queries-on-a-specific-field-tp4217678p4220396.html Sent from the Solr - User mailing list archive at Nabble.com.
Solrcloud: 1 server, 1 configset, multiple collections, multiple schemas
Hello, I'm having usage issues with *Solrcloud*. What I want to do: - Manage a solr server *only with the API* (create / reload / delete collections, create / replace / delete fields, etc). - A new collection should* start with pre-defined default fields, fieldTypes and copyFields* (let's say, field1 and field2 for fields). - Each collection must *have its own schema*. What I've setup yet: - Installed a *Solr 5.3.1* in //opt/solr/ on an Ubuntu 14.04 server - Installed *Zookeeper 3.4.6* in //opt/zookeeper/ as described in the solr wiki - Added line "server.1=127.0.0.1:2888:3888" in //opt/zookeeper/conf/zoo.cfg/ - Added line "127.0.0.1:2181" in //var/solr/data/solr.xml/ - Told solr or zookeeper somewhere (don't remember where I setup this) to use //home/me/configSet/managed-schema.xml/ and //home/me/configSet/solrconfig.xml/ for configSet - Run solr on port 8983 My //home/me/configSet/managed-schema.xml/ contains *field1* and *field2*. Now let's create a collection: http://my.remote.addr:8983/solr/admin/collections?action=CREATE&name=collection1&numShards=1 - *collection1 *is created, with *field1 *and *field2*. Perfect. Let's create another collection: http://my.remote.addr:8983/solr/admin/collections?action=CREATE&name=collection2&numShards=1 - *collection2 *is created, with *field1 *and *field2*. Perfect. No, if I *add some fields* on *collection1 *by POSTing to : /http://my.remote.addr:8983/solr/collection1/schema/ the following: - *field3 *and *field4 *are successfully added to *collection1* - ... but they are *also added* to *collection2* (verified by GETting /http://my.remote.addr:8983/solr/collection2/schema/fields/) How to prevent this behavior, since my collections have *different kind of datas*, and may have the same field names but not the same types? Thanks, Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Solrcloud-1-server-1-configset-multiple-collections-multiple-schemas-tp4243584.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Solrcloud: 1 server, 1 configset, multiple collections, multiple schemas
I understand. How to do this via the API? -- View this message in context: http://lucene.472066.n3.nabble.com/Solrcloud-1-server-1-configset-multiple-collections-multiple-schemas-tp4243584p4243737.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Solrcloud: 1 server, 1 configset, multiple collections, multiple schemas
F*ck. I switched from normal Solr to SolrCloud, thanks to the feature that allow to create cores (collections) on-the-fly with the API, without having to tell Solr where to find a schema.xml / a solrconfig.xml and let it create them itself from a pre-defined configset. If I understand well, there is actually no way to create a core or a collection from the API, with a defined-at-once configset, without having to do some CLI commands on the remote server? Thanks for your reply, Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Solrcloud-1-server-1-configset-multiple-collections-multiple-schemas-tp4243584p4244010.html Sent from the Solr - User mailing list archive at Nabble.com.
Log numfound, qtime, ...
Hello everyone, Here's my need : I'd like to log Solr Responses so as to achieve some business statistics. I'd like to report, as a daily/weekly/yearly/whateverly basis, the following KPIs : - Most popular requests (hits) - Average numfound for each request - Average response time for each request - Requests that have returned an error - Request that have a numfound of 0. The idea is to give the searchandizer the keys to analyze and enhance in real-time the relevancy of his data. I think it's not the job of a developer to detect that the keyword TV never has results because "Television" is the referring word in the whole catalog, for instance. The searchandizer should analyze this at anytime and provide the correct synonyms to improve relevance. I'm using Solr with PHP and the Solarium library. Actually the only way I found to manage this, is the following way : 1. The user sends the request 2. Nginx intercepts the request, and forwards it to a PHP app 3. The PHP app loads the Solarium library and forwards the request to Solr/Jetty 4. Solr replies a JSON and Solarium turns it into a PHP Solarium Response Object 5. The PHP app sends the user the raw JSON through NGINX (as if it were Jetty) 6. The PHP app stores the query, the QTime and the numfound in a database I think I'll soon get into performance issues, as you guess. Do you know a better approach ? Thanks, Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Log-numfound-qtime-tp4189561.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Log numfound, qtime, ...
Hello everyone, I'll check this ASAP. Thanks for all your answers ! Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Log-numfound-qtime-tp4189561p4191129.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Bad contentType for search handler :text/xml; charset=UTF-8
Hello, I've got the same issue after an upgrade from Solr 5.0 to 5.1, even on GET requests. Actually i'm using PHP Solarium library to perform my requests. This is the error the library gets now, on a search handler. The request is transported with cUrl. What's weird is when I copy/paste the Url Solarium generates in my browser, I don't get the error. Maybe Solr 5.1 requires a new header which is automatically sent by the browser but not by cUrl. I'll investigate on this... Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Bad-contentType-for-search-handler-text-xml-charset-UTF-8-tp4200314p4201564.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Bad contentType for search handler :text/xml; charset=UTF-8
Looks like Solarium hardcodes a default header "Content-Type: text/xml; charset=utf-8" if none provided. Removing it solves the problem. It seems that Solr 5.1 doesn't support this content-type. -- View this message in context: http://lucene.472066.n3.nabble.com/Bad-contentType-for-search-handler-text-xml-charset-UTF-8-tp4200314p4201579.html Sent from the Solr - User mailing list archive at Nabble.com.
Multiple boost queries on a specific field
Hello, I'm trying to use the boost queries for the 1st time and I need some help. Let's assume my documents have a /provider /field, which is populated by a string, i.e. A, B, C, D, E. I'd like to assign weight to providers. A is /^2.0/, B is /^1.5/ and the others are 1.0. So, if I run the following query : /?q=&wt=json&defType=dismax&q.alt=*:*&bq=provider:A^2.0/ My first results have provider A. Let's try another one : ?q=&wt=json&defType=dismax&q.alt=*:*&bq=provider:B^1.5 My first results have provider B. Good! But that's not exactly what I'm looking for (otherwise I'd just made a filterQuery). What I want is a /multiple /boost query. So I tried : /?q=&wt=json&defType=dismax&q.alt=*:*&bq=provider:(A^2.0 B^1.5)/ Then my first results have provider B. It's not logical. I tried another syntax : /?q=&wt=json&defType=dismax&q.alt=*:*&bq=provider:A^2.0&bq=provider:B^1.5/ But nothing changes. Can you help me ? My 2nd problem is that I would like to give some weight to the newer documents, but in a range of a month. That means, if a document named B1 with provider B (weighs 1.5) is newer than a document named A1 with provider A (weighs 2.0), I want that B1 gets on top of A1 /only /if the difference between their dates are /at least 1 month/. Do you know how to do this ? Since my boost logic depends on the user navigation, I have to realize this only at query-time. Thanks for your help, Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Multiple-boost-queries-on-a-specific-field-tp4217678.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Multiple boost queries on a specific field
Hello, I'm using q.alt because q=*:* provides 0 result, since it is not compatible with the Dismax parser. The "real terms" is irrelevant here, since I want to boost some documents, either on the whole collection, either after defining some filter queries. My queries have nothing to deal with a fulltext search in this case. For the 2nd query, "close enough" is not... enough :) I already read the docs for this, but the relevancy here is on a second-basis, and I want a month-basis. I chose Solr for the ease of boosting, otherwise I would have chosen a basic MySql database to store and query my documents. Sad to realize things are not that easy... :( Thanks, Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Multiple-boost-queries-on-a-specific-field-tp4217678p4217829.html Sent from the Solr - User mailing list archive at Nabble.com.
Field Value depending on another field value
Hello, I'm pretty new to Solr, and I have a question about best practice. I want to handle a Solr collection with products that are available in different shops. For several reasons, the price of a product may be the same or vary, depending the shop's location. What I don't know how to handle correctly is the ability to have a price that is a multivalued notion, which value depends on another field. Imagine the following product into the collection : { id: 123456, name: "The Wonderful product", SellableInShop: [1, 3], Price: 0, PriceInShop1: 34.99, PriceInShop2: 0, PriceInShop3: 38.99 } Behaviour I want when the user searchs for "wonderful" after selecting the shop #3 /query?q=wonderful AND SellableInShops:3 { id: 123456, name: "The Wonderful product", SellableInShop: [1, 3], Price: 38.99 } My question is : how to fill, at query-time, the content of a field "Price", depending on 2 other fields : SellableInShop and PriceInShop3 (PriceInShop2 if SellableInShop == 2, PriceInShop1 if SellableInShop == 1, etc) ? Thanks a lot, Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Field-Value-depending-on-another-field-value-tp4098047.html Sent from the Solr - User mailing list archive at Nabble.com.
Issues with multicore management
Hello, I'm having issues with multicore management. What I want to do : *1st point :* Create new cores on the fly without restarting the Solr instance *2nd point :* Have these new cores registered in case of restarting Solr instance So, I tried *config A* : /solr.xml/ : Then I duplicated the /example/multicore/core2/ directory to /example/multicore/core3/ and ran the following URL : http://localhost:8983/solr/admin/cores?wt=json&indexInfo=false&action=CREATE&name=core3&instanceDir=core3&dataDir=data&config=solrconfig.xml&schema=managed-schema.xml This was *successfull*. My core was then listed in the Solr Admin UI http://localhost:8983/solr/#/~cores Problem : after restarting the start.jar, *only core1 and core2 appear*. This config handles the *1st point* but not the *2nd one*. So I tried *config B* : /solr.xml/ : Then I put a /core.properties/ file in each core directory with /name=core1/, /name=core2/. core1 and core2 are *automatically discovered*. I duplicated core2 to core3 directory and changed /core.properties/ with /name=core3/. Then I ran the CREATE URL : http://localhost:8983/solr/admin/cores?wt=json&indexInfo=false&action=CREATE&name=core3&instanceDir=core3&dataDir=data&config=solrconfig.xml&schema=managed-schema.xml *SuccessFull*. BUT : my core *isn't listed* in the Admin UI. So, I tried to reload it : http://localhost:8983/solr/admin/cores?action=RELOAD&core=core3&wt=json&indent=true { "responseHeader":{ "status":400, "QTime":3}, "error":{ "msg":"Core with core name [core3] does not exist.", "code":400}} However : http://localhost:8983/solr/admin/cores?action=STATUS&core=core3&wt=json&indent=true { "responseHeader":{ "status":0, "QTime":1}, "initFailures":{}, "status":{ "core3":{}}} When I restart start.jar, the core is OK. So, this config handles the *2nd point* but not the *1st one*. What am I doing wrong ? I'm running Solr 4.7.0. Thanks, Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Issues-with-multicore-management-tp4121107.html Sent from the Solr - User mailing list archive at Nabble.com.
Exception writing document to the index; possible analysis error.
Hello everyone, I'm losing my hair trying to add a simple document on a freshly installed Solr core. I'm running Solr 4.10.2 on jetty with the start.jar. I have the following (managed) schema and my core has been reloaded : Consider my core have 0 document. Now I'm trying to add a document via the /update API command : And here's the server reply : What the hell am I doing wrong ? Thank you for your help, Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Exception-writing-document-to-the-index-possible-analysis-error-tp4174845.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Exception writing document to the index; possible analysis error.
Hello, Thanks for your reply. That's what I understand when I look at the exception. However, if you look at my XML update command, there's no empty string anywhere. That's why I don't understand why this exception is raised. Thanks, Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Exception-writing-document-to-the-index-possible-analysis-error-tp4174845p4174932.html Sent from the Solr - User mailing list archive at Nabble.com.
[Resolved] Exception writing document to the index; possible analysis error.
Ok, sorry but the issue was located between my keyboard and my chair. The field "_collection_id" is required in the schema and not filled in my update request. As the exception didn't warn me about any required field, I didn't look at this. Thanks anyway, Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Exception-writing-document-to-the-index-possible-analysis-error-tp4174845p4174936.html Sent from the Solr - User mailing list archive at Nabble.com.
Update field properties via Schema Rest API ?
Hello, I'm pretty new to Solr, as a PHP developer. I'm still reading the tutorials for getting started with Solr, adding and indexing data. I'm still using the example/start.jar, as I still didn't succeed to config a true (production-ready) Solr instance. But doesn't matter. As I can't deal with Java, Tomcat etc, I just want to do the maximum things with the REST API, for not having to edit any file. I have needs in adding and editing fields frequently, so I use the Schema Rest API. However, the wiki http://wiki.apache.org/solr/SchemaRESTAPI explains how to add fields, but not to update or delete them. Can you help me ? I really need to control (e.g. update) the properties of my fields (indexed, stored, multiValued, etc) via the REST API, without having to edit any file each time I need an update. Thanks, Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Update-field-properties-via-Schema-Rest-API-tp4087907.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Update field properties via Schema Rest API ?
Hello, Thanks for your quick reply. This is what I feared. Do you know if this is planned for Solr 4.5 or Solr 5.0 ? I didn't see anything about it in the roadmap. Thank you, Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Update-field-properties-via-Schema-Rest-API-tp4087907p4087920.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Update field properties via Schema Rest API ?
Hello Erick, Thank you for your reply. Unfortunately, yes it is. I work with a company that has a catalog with many new attributes every day, and sometimes the existing ones change. For instance, one attribute may live with the unit for months (e.g. screen_size ="32 cm") and one day my provider change it to an integer (screen_size = 32), making it easier to create ranges. Besides I want my business users to be able to add and edit new features on their products, and my php middle-end app just should communicate with solr without me. We actually work with a solution that works that way (users do everything, the middle-app controls the users' inputs and deals with the back-end), and dealing with the open-source solr is really hard if that essential feature isn't provided... :( That's why I was very happy when Solr 4.4 introduced the add field by the REST API, that works very well, but I was disapointed that any new field couldn't be edited (just "indexed" and "stored" true / false would be amazing) without I have to edit any file. So I really hope this part of the API will soon be completed :) Best regards, Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Update-field-properties-via-Schema-Rest-API-tp4087907p4087951.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Update field properties via Schema Rest API ?
By the way, Is there a place where we can post our feature requests on Solr ? Besides this one, it would be great to be able to tell Solr in the schema.xml, that the default value of a field, is the value of another field, instead of a static value. Best, Ben -- View this message in context: http://lucene.472066.n3.nabble.com/Update-field-properties-via-Schema-Rest-API-tp4087907p4092481.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Update field properties via Schema Rest API ?
Haha, Thanks for your reply, that's what I'll do then. Unfortunately I can speak Java as well as I can speak ancient Chinese in Sign Language... ^^ -- View this message in context: http://lucene.472066.n3.nabble.com/Update-field-properties-via-Schema-Rest-API-tp4087907p4092507.html Sent from the Solr - User mailing list archive at Nabble.com.