Database Query Search Time
|
08-13-2010, 09:54 PM
(This post was last modified: 08-13-2010 09:56 PM by green-watch.org.)
Post: #11
|
|||
|
|||
RE: Database Query Search Time
Hey Guys,
I am having a bit of trouble with SOLR. Here is my code: Code: <cfsetting requestTimeOut = "6000"> Here is my current testing page for it: http://www.green-watch.org/test.cfm How do I get it to return products where the product price is between 0 and 350 dollars? I am trying this in the code: criteria="custom2: 0 TO 350" - but it is not working. Thanks in advance for any suggestions. Sincerely, Travis Walters |
|||
08-13-2010, 10:06 PM
Post: #12
|
|||
|
|||
RE: Database Query Search Time
I dont know anything abt cold fusion, so cant be much of a help. but in your code above I see SQL queries. are you sure you are running them by solr?
If you can PM me the url of the solr instalation, i can take a look and figure out the paramaters needed for this... cdnplanet.com: We help you select the right CDN |
|||
08-13-2010, 10:14 PM
Post: #13
|
|||
|
|||
RE: Database Query Search Time
Hey Sajal,
I am positive that the "product_collection" is a SOLR collection. I verified this by looking in the coldfusion administrator. I am not sure what URL you would need? Our hosting company installed coldfusion 9 on the server and SOLR comes with it. The "PRODUCT_COLLECTION_CHECK" cfquery at the beginning of the code checks to make sure a SOLR collection exists. The "PRODUCT_LIST" cfquery grabs the top 100 products in the database to populate the SOLR index through cfindex. Finally, the cfsearch call searches that index via SOLR. I know I have to be close to having this right and it is probably something really simple that is needed to get it working correctly. Sincerely, Travis Walters |
|||
08-14-2010, 03:38 AM
Post: #14
|
|||
|
|||
RE: Database Query Search Time
hmm... SOLR is usually an independent web service and applications connect to it using REST...
check out the docs for filter query : http://wiki.apache.org/solr/CommonQueryParameters#fq Try changing Code: <cfsearch collection="product_collection" criteria="custom2: 0 TO 350" name="results" status="r" suggestions="always" to Code: <cfsearch collection="product_collection" criteria="custom2:[0 TO 350]" name="results" status="r" suggestions="always" cdnplanet.com: We help you select the right CDN |
|||
08-14-2010, 06:29 AM
Post: #15
|
|||
|
|||
RE: Database Query Search Time
Hey There,
I tried changing that value to what you said, but it is returning 69 out of the 100 results. It still has results over 350 dollars though as you can see here: http://www.green-watch.org/test.cfm Any other suggestions are greatly appreciated. Thanks in advance ![]() Sincerely, Travis Walters |
|||
08-14-2010, 06:50 AM
(This post was last modified: 08-14-2010 06:51 AM by sajal.)
Post: #16
|
|||
|
|||
RE: Database Query Search Time
Ask the hosting company on how to access SOLR directly....
It should look something like this... ![]() Then play in it... see the records in it.... maybe the values ur setting are being stored as string? I think this is a question for a programing site like http://stackoverflow.com/ or similar... cdnplanet.com: We help you select the right CDN |
|||
08-14-2010, 06:58 PM
Post: #17
|
|||
|
|||
RE: Database Query Search Time
Hey Sajal,
I ended up finding the location of that utility on my own through the coldfusion administrator. I found some code on the internet as well. Code: <cfif isdefined("url.create")> You can see how the "key" is set to an "integer" here. However, under that SOLR utility, it says "Field Type: STRING". For custom1, it says the field type is TEXT. I am not sure if there is any way to change a field to have an integer type? I found it strange how the code example's price column was set to varchar instead of integer. I noticed "custom1:700 TO 1500" will return keys 3 and 2. However, "custom1:700 TO 1499" will return keys 3 and 1. Obviously the 1499 key should be returned when the range is 700 to 1500 but it's not. Why is this? Thanks for anymore information. I would really love to figure this out so I can finish my product section. By the way, I am willing to pay for assistance with this: http://www.vworker.com/RentACoder/misc/B...Id=1474266 Sincerely, Travis Walters |
|||
08-15-2010, 12:11 PM
Post: #18
|
|||
|
|||
RE: Database Query Search Time
Hey There,
Many somebody will know these answers to these questions: 1. When I am indexing a collection of data for SOLR, for the product price field, should I input price ranges instead of the actual product price? For example, if a product costs 393.54, the product price could be [100_400][100_500][100_600][200_400][200_500] etc. Then when I use a product search I could look for the range within that list of strings. The problem I see with this is there are so many different combinations of price ranges that the collection may get bloated? 2. Look at this solr query string: http://localhost:8983/solr/sitecontent2/select/?q=custom1:700%20TO%201500&version=2.2&start=0&rows=10&indent=on If I have a product priced 1499, why is that product not returned in the results? http://www.green-watch.org/test2.cfm?index=yes (thats whats in this index) Thanks for any suggestions. Sincerely, Travis Walters |
|||
08-15-2010, 11:06 PM
Post: #19
|
|||
|
|||
RE: Database Query Search Time
Hey Guys,
I figured out how to do price ranges. After I finish up the script, I will write a little tutorial on here to help other people out that come across this thread. Sincerely, Travis Walters |
|||
08-16-2010, 02:55 AM
Post: #20
|
|||
|
|||
RE: Database Query Search Time
Awesome. How does the end result look for performance compared to when you started the thread?
I'm in the process of setting up a performance knowledgebase here: http://www.webperformancecentral.com/wiki/Main_Page so if you want to document it there and link to it from here that would be great (or I can clone it over there if you'd like). There are a lot of gems of knowledge that are starting to turn up as people work through issues and I thought it would be good to have an actual home for them. Thanks, -Pat |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)