A Google-like Full Text Search

  • Hi Mike, thanks for the quick reply =P

    For what I've been told on Irony forums.. it does use several 3.5 specific features, but they think your code is not using those specific things. I should try downloading the source code from Irony and start cleaning the 3.5 things to make it work.

    I'll do it tomorrow, if it doesn't work, you'll be hear of me again =P

    Thanks and greetings!

  • So, did you manage to make it play with .NET 2.0?

    I'm in a similar situation and I could use a little help...

  • OK, I made it functional with 2.0. In Irony website there's a post regarding this issue.

    After that, the only problem was that the current Irony code and the SearchGrammar given in this article were incompatible. I was given different results with the 2 dlls.

    So, i Just compiled an earlier version of Irony and everything is normal

  • great post Mike, exactly what I was looking for.

    Thanks for this awesome article

    Saqib

  • Copyright Info

    Someone asked me about copyright on the source code for this article. I can sum it up in one sentence:

    "Feel free to use the source code however you like."

    I always felt that anyone who publishes source code (with or without an article) should have a reasonable expectation that people will use it in their own projects (assuming people find the code useful). So if you find the source code that I published with this article (or any of my other articles) useful, feel free to use it in your own projects, modify it to suit your needs, do whatever you like with it.

    Keep in mind that the code for this article uses Irony.net, which has its own copyright and licensing. I believe the creator of Irony.net has published his code as open source under a very permissive license. You'll have to check the Irony project on the Codeplex site for specifics on Irony.net's license and to ensure that it's compatible with your organizational policies though.

    Thanks and enjoy!

    Michael Coles

  • Excellent! Just used this to add full-text indexing to my own website.

    I don't agree with the negative comments and I also think the title "A Google-link Full Text Search" is appropriate for the article. Not sure what people were expecting but for me this was exactly what I wanted. 🙂

    The example provided was simple enough and I was able to adapt it to my own needs very quickly. In my implementation, the fulltext query is passed as a parameter to a search stored procedure and I use CONTAINSTABLE instead of CONTAINS to produce a ranking for the search results that can be used for sorting purposes. Some minor bugs/features, but overall the searching seems to work quite well.

    I'm happy with the fulltext rankings for now, but I guess if someone wanted they could easily apply some sort of weighting to the fulltext ranking. e.g. Based on the number of link backs, user rating or other method. I think it would be pointless to include something like this in the example - it would only add additional complexity to the code without adding any real benefit. I imagine that customized ranking algortithms will be very different from one implementation to the next.

    This was a very easy way to implement a full-text search for my website, using a syntax very close to the one used by most people's favourite search engine. Many thanks to Michael for this article.

    DBA Dash - Free, open source monitoring for SQL Server

  • panteluke (2/9/2009)


    OK, I made it functional with 2.0. In Irony website there's a post regarding this issue.

    After that, the only problem was that the current Irony code and the SearchGrammar given in this article were incompatible. I was given different results with the 2 dlls.

    So, i Just compiled an earlier version of Irony and everything is normal

    Is there a way you could share it with us?

    Thanks

    Jerome

  • I will send you the 2 dlls. Irony and LinqBridge

  • panteluke (3/6/2009)


    I will send you the 2 dlls. Irony and LinqBridge

    Thanks for your help.

  • Hi Mike,

    Great work! If I wanted to add the word "NOT" as an operator, would I just change

    ExcludeOperator.Rule = Symbol("-")

    to

    ExcludeOperator.Rule = Symbol("-") Or Symbol("not")

    Thanks

    James

  • Hi Mike

    It's a great article but I was hoping you could help me out with a problem that is driving me potty. :crying:

    I implemented the code on my desktop machime and everything went well and run as expected, however the trouble came when I tried to set it up on my laptop.

    When doing a search for "hi there" the results that are returned are as if I had entered Hi OR there

    When I do a search for hi there then nothing is returned, similary doing as a search for hi AND there returns nothing

    Both machines are running sqlserver 2005 and both databases have the same data, do you have any idea what could be causing this?

  • Give this a try to change handling of noise words:

    EXEC sp_configure 'show advanced options', 1

    GO

    RECONFIGURE

    GO

    EXEC sp_configure 'transform noise words', 1

    GO

    RECONFIGURE

    GO

    DBA Dash - Free, open source monitoring for SQL Server

  • wiseman1982 (3/30/2009)


    Give this a try to change handling of noise words:

    EXEC sp_configure 'show advanced options', 1

    GO

    RECONFIGURE

    GO

    EXEC sp_configure 'transform noise words', 1

    GO

    RECONFIGURE

    GO

    Cheers, that seemed to do the trick, what's all that about then?

  • james.spibey (3/30/2009)


    Hi Mike,

    Great work! If I wanted to add the word "NOT" as an operator, would I just change

    ExcludeOperator.Rule = Symbol("-")

    to

    ExcludeOperator.Rule = Symbol("-") Or Symbol("not")

    Thanks

    James

    Hi James,

    I can't look into it right now, but you can definitely try it and see if it gives the correct result. It should definitely be a simple change along those lines. I'll check into myself later to see if I can find any hidden "gotcha's".

    Thanks

    Mike C

  • Matt (3/30/2009)


    wiseman1982 (3/30/2009)


    Give this a try to change handling of noise words:

    EXEC sp_configure 'show advanced options', 1

    GO

    RECONFIGURE

    GO

    EXEC sp_configure 'transform noise words', 1

    GO

    RECONFIGURE

    GO

    Cheers, that seemed to do the trick, what's all that about then?

    Good call wiseman. I just saw this one myself. For Matt, the 'transform noise words' option determines how SQL handles so-called noise words (or 'stop words' in SQL 2008). Basically words that occur frequently but don't normally add value to a query are (by default) eliminated from full-text search queries. Words like "the", "and", "of", etc. are considered noise words. "Hi" and "there" are probably noise words also, although I'd have to look in the noisewords.txt file on 2005 to see for sure.

Viewing 15 posts - 46 through 60 (of 166 total)

You must be logged in to reply to this topic. Login to reply