Database Query Search Time
|
08-22-2010, 09:12 PM
(This post was last modified: 08-22-2010 11:35 PM by green-watch.org.)
Post: #34
|
|||
|
|||
RE: Database Query Search Time
Hey Everyone,
In my last post, I questioned if it was possible to tell SOLR that a field should be numeric as opposed to text. The answer is yes and here is how: You need to find the path where you store the collection. For example, mine is: F:\collections\products_id2\conf In this directory, there is a file called schema.xml. Open that with notepad. Do a search for custom3 for example and you will see where the value is set to text. I changed this to integer. I also changed indexed="false" to indexed="true" for the key value. It appears SOLR only allows sorting by indexed fields. Once I changed the index to true, then I could sort by the key. I remember earlier I was having trouble with the custom2 field where I was storing the price. I bet if I changed that to integer and reindexed my products I could use those ranges I was playing around with that would not work before. I plan to create a second collection later this week with prices instead of price ranges and see if it will work. Update: It appears if you change the schema values, your collection may need reindexed before fields are sorted correctly. For example, I could sort by key ascending, but not key descending. Once I indexed a test collection, it sorted correctly. Sincerely, Travis Walters |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)