A Google-like Full Text Search

  • Ahhh, you need to handle unbalanced parentheses. I believe Irony continues to try to parse your input string after an error is encountered. You may be able to leverage that functionality, although to be honest if the user gives you unbalanced parens they might not get expected results from their search.

  • webmaster 46469 (4/19/2011)


    Mike, first off good article. It opened my eyes to so many other possibilities and efficient ways to use the search features in my db. I have a two part question. I'm implementing this search into an existing vb.net project. I believe that the only file I needed to copy over and edit was the SearchGrammar file. My questions are:

    1. In my project, if I reference the Irony dll you included with the sample and converted SearchGrammar.cs to a vb file, would that include all I need from your project to make the changes to my current search?

    2. If the above would work, would I even need to convert the cs file or would this (http://pietschsoft.com/post/2006/03/30/ASPNET-20-Use-VBNET-and-C-within-the-App_Code-folder.aspx) be a possibility for including the file directly into a vb project.

    Thanks for any help you can provide.

    Hi webmaster

    Glad you found it helpful. You just need to reference Irony.dll from any .NET project that uses it. Your source code could be in C#, VB, C++ (managed), etc. If you compiled down the SearchGrammar.cs to a .dll file you can reference it from any .NET language as well. No need to convert the source.

    Thanks

    Mike C

  • Thanks for the help Mike. I've been able to move forward with some testing. Was able to reference the irony dll.

    One issue I'm having on build now is:

    Object reference not set to an instance of an object.

    root = _compiler.Parse(keywords.ToLower())

    Is there something I'm doing wrong to convert the string to an AstNode?

  • webmaster 46469 (4/21/2011)


    Thanks for the help Mike. I've been able to move forward with some testing. Was able to reference the irony dll.

    One issue I'm having on build now is:

    Object reference not set to an instance of an object.

    root = _compiler.Parse(keywords.ToLower())

    Is there something I'm doing wrong to convert the string to an AstNode?

    That's not enough code to tell what's wrong. Are you initializing the _compiler object somewhere? My guess would be that this is what's missing.

  • I initialize the compiler earlier,

    Dim _compiler As Irony.Compiler.LanguageCompiler

  • webmaster 46469 (4/21/2011)


    I initialize the compiler earlier,

    Dim _compiler As Irony.Compiler.LanguageCompiler

    You declared it, but didn't instantiate it. Try something like this:

    Dim _compiler As New Irony.Compile.LanguageCompiler

    (I'm not 100% sure what the constructor is for this class, but you should find out when you do this)

  • Got it working. I wasn't including the _grammar object. Using the code below I've got it fixed. Thanks for you help.

    _grammar = New SearchGrammar()

    _compiler = New Irony.Compiler.LanguageCompiler(_grammar)

  • Good deal. If you need more info, there are some really good code samples in the Irony source download at http://www.sourceforge.net/irony.

    Thanks

    Mike C

  • Not sure if anyone is still reading this post, but I'm trying to find the lkuptbl.dll that's required to run this script?

    Without it my global.asa file throws up an error and I can go no further.

    Have looked all over and found plenty of other people looking for the file (years ago) , but no joy in finding a copy myself.

    I'm guessing there are other ways available by now to work the dictionary object, but what I've found has been over my head ...

    Any help will be much aprpeciated!

    Matt

  • Never heard of lkuptbl.dll. Can you be more specific with an exact error message, maybe the code that's causing problems?

  • Hey Mike,

    Thanks for your help ...

    When I install the provided scripts, the global.asa file throws the follwonig error ..

    The object has an invalid ProgID of 'IISSample.LookupTable'.

    Looking around, the best explanation I've been able to find is that it refers to the lkuptbl.dll file, which isn't registered on my machine (windows 2003 server) ... hence the error.

    Guessing there's other ways to load/use the noise words list, but it's all a bit beyond me.

    As it is, since posting yesterday I've realised I need containstable or freetexttable if i want to ranking the results ... so I don't think I'll be able to use this anyway.

    Cheers

    Matt

  • mbrading (5/16/2011)


    Hey Mike,

    Thanks for your help ...

    When I install the provided scripts, the global.asa file throws the follwonig error ..

    The object has an invalid ProgID of 'IISSample.LookupTable'.

    Looking around, the best explanation I've been able to find is that it refers to the lkuptbl.dll file, which isn't registered on my machine (windows 2003 server) ... hence the error.

    Guessing there's other ways to load/use the noise words list, but it's all a bit beyond me.

    As it is, since posting yesterday I've realised I need containstable or freetexttable if i want to ranking the results ... so I don't think I'll be able to use this anyway.

    Cheers

    Matt

    It seems to me you're using someone else's code sample. Unfortunately I'm not in a position to troubleshoot it. Try downloading the code supplied with the article and compare. Also, if your code sample uses FREETEXT or CONTAINS, it's trivial to convert to FREETEXTTABLE or CONTAINSTABLE.

    Thanks

    Mike C

  • Definitely the right code Mike ...

    The first line in the global.asa file is the problem ...

    object id="NoiseWords" progid="IISSample.LookupTable" runat="Server" scope="Application"

    That progid is not valid on my system?

    Looking around the web for the error message, it does sound like a number of other people had the same issue, but I'm yet to find anyone who got it sorted? It's a long tiem since this code was originally posted though, so that sure doesn't help.

    Anyway, I've got a different approach more-or-less working now, so I'll persevere with that.

    Thanks for your assistance,

    Matt

  • mbrading (5/17/2011)


    Definitely the right code Mike ...

    The first line in the global.asa file is the problem ...

    object id="NoiseWords" progid="IISSample.LookupTable" runat="Server" scope="Application"

    That progid is not valid on my system?

    Looking around the web for the error message, it does sound like a number of other people had the same issue, but I'm yet to find anyone who got it sorted? It's a long tiem since this code was originally posted though, so that sure doesn't help.

    Anyway, I've got a different approach more-or-less working now, so I'll persevere with that.

    Thanks for your assistance,

    Matt

    Hi Matt,

    I just re-downloaded my ZIP file from the attached article. Just verified there is no global.asa file in the ZIP file. The sample code attached to the article is a Windows Forms app, not an ASP.NET app. Can you point me at the location from which you downloaded the ASP.NET code? I'd like to take a look at it.

    FWIW I did a Google Search on the dll file you mentioned earlier in the article. I found about 120 hits on that filename, the vast majority of them are very old postings (all the way back to 2003 so far). All references to it seem to be to VB (not .NET) COM programming. At first glance it almost appears to be some sort of Access and/or Excel COM component. Didn't really use any COM in this article, so I am really, really interested in seeing the code you obtained if you can post a link to where you downloaded it from.

    Thanks

    Mike C

  • Hi Mike,

    Very sorry ... a different bookmark for a different download.

    This was an asp script doing a similar conversion job.

    Sorry to waste your time.

    Regards

    Matt

Viewing 15 posts - 136 through 150 (of 166 total)

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