Zonkle wrote:
Hi man,
Take a look at this pic and you will now what i want to search in :
So in the search box at the website, the user can enter more than one word, like: LLBLGen Pro
Did you get me ?
Thank you.
Ok, that would result in something like:
SELECT * FROM products where productname LIKE '...' OR productname LIKE '...' OR...
OR it would result in something like:
SELECT * FROM products where productname IN ('..', '..', '..' )
IF you're searching through a single column.
IF you want to search blocks of texts for the productnames specified, you can't use the second option, you can use the first: this forum for example first used full text search but I had the same problem as you: this site is hosted on a shared server of an ISP, so full text search wasn't possible, I then rewrote the search to use LIKE .. OR LIKE... OR... searching, to search in the text fields which contain the message texts.
If the text to search through isn't that big, you get good results.
So it's not how they specify the product names
but what you want to search that's important for my answer
The reason I ask this is because if you have to search through 100,000 textblocks of 4KB of text or more using LIKE, it isn't going to be fast. You then have to go a different route: keyword lists.
Add a table which contains per word a list of records which textblock contains that word. You can store this in your situation in a productname | articleID fashion for example if you have to search through articles to see if they contain the product name.
You can then find back the articles very fast by querying that table.
To fill that table, either use a custom crawler process which strips articles for keywords and stores the keyword-articleid in the table, or do that when you store a new article/alter the article.
This forum will get such a system soon, as the search begins to slow down (it has to wade through 14,000 messages already)