Current time: 01-28-2021, 08:05 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Database Query Search Time - pmeenan - 07-04-2010, 12:03 PM
RE: Database Query Search Time - pmeenan - 07-05-2010, 04:35 AM
RE: Database Query Search Time - sajal - 07-05-2010, 05:03 AM
RE: Database Query Search Time - pmeenan - 07-08-2010, 08:47 PM
RE: Database Query Search Time - sajal - 08-13-2010, 10:06 PM
RE: Database Query Search Time - sajal - 08-14-2010, 03:38 AM
RE: Database Query Search Time - sajal - 08-14-2010, 06:50 AM
RE: Database Query Search Time - pmeenan - 08-16-2010, 02:55 AM
RE: Database Query Search Time - sajal - 08-17-2010, 01:14 AM
RE: Database Query Search Time - green-watch.org - 08-22-2010 09:12 PM
RE: Database Query Search Time - pmeenan - 08-23-2010, 01:22 AM
RE: Database Query Search Time - pmeenan - 08-23-2010, 08:45 PM
RE: Database Query Search Time - ringman57 - 08-24-2010, 11:52 PM
RE: Database Query Search Time - ringman57 - 08-25-2010, 02:54 AM

Forum Jump:


User(s) browsing this thread: 2 Guest(s)