August 16, 2009 at 8:15 pm
Using irony with IIS
I would guess that it is possible to incorporate the irony compiler as an assembly in IIS. My road block is finding a "how to" in order to set it up. It would be great to add this feature to some of our existing intranet searches. Anybody willing to provide step by step? 😀
August 17, 2009 at 2:19 am
Hi Michael,
I am going to use irony-based query parser into webservice.
I do not see any problem to do it.
Regards,
Oleg.
August 17, 2009 at 4:35 am
Ah Grasshopper
Thanks for chiming in. I actually worked out the details of the assembly for the website. I will post the steps later as I think others may want to know how to do this.
-Michael
August 17, 2009 at 10:12 am
michael.nathan.white (8/17/2009)
Ah GrasshopperThanks for chiming in. I actually worked out the details of the assembly for the website. I will post the steps later as I think others may want to know how to do this.
-Michael
Yes, exactly 😉
August 17, 2009 at 10:19 am
Just as a starting advice, for use in web server. Using Irony in any app involves some start-up time, when it builds parsing tables for particular grammar - search grammar in this case; it takes a few tens of milliseconds. This activitiy should probably performed once, at web app startup and then the result (LanguageData object) should be cashed in application-wide object for use in all incoming requests. This object is immutable, so sharing should be safe. In an incoming request, the code should instantiate parser object using shared LanguageData instance and then proceed to process the input string.
August 18, 2009 at 5:34 pm
All issues are fixed in the latest Irony source drop (08/18). International chars are now supported, no confusion of prefixes with matching operators. Please test it with database - I didn't test the actual transformation method.
September 29, 2009 at 4:44 am
You can add (and replace existing) following lines to support all unicode characters:
string additionalTermCharacters = "";
//Add international (unicode) characters
for (int i = 192; i < 512; i++)
additionalTermCharacters += (char)i;
// Terminals
var Term = new IdentifierTerminal("Term", "!@#$%^*_'.?" + additionalTermCharacters, "!@#$%^*_'.?0123456789" + additionalTermCharacters);
September 29, 2009 at 11:58 pm
I tried to compile it with newest Irony.
I managed to fix errors due to methods change on Irony, but Grammar doesn't work.
With just these changes (new Irony, and changed error handling) it gives me errors like Keyword is missing on start end...
Did anyone tried to use newest Irony?
September 30, 2009 at 8:46 am
Use the SearchGrammar that is in Irony.Samples assembly in latest Irony sources
September 30, 2009 at 8:59 am
Sorry I've been out of the loop for a while. Thanks for the update Roman! If you don't mind I'll grab the newest Irony DLL and rebuild the sample with the updated grammar, and ask Steve to put the new code up as a download for this article. It might take me until the weekend to get to it, but I've got it on the radar.
Thanks
Mike C
October 13, 2009 at 9:19 pm
developmentalmadness (10/15/2008)
Very cool. It's exactly what I needed. I'm implementing a search and didn't want users to have to learn FTS syntax. Thanks for your work.I'm running into a problem with the OR operator. If I search for the term "orange" (no quotes in search, just for clarity here) I get the following error:
Syntax error, expected: OrExpression AndExpression PrimaryExpression ThesaurusExpression ThesaurusOperator ExactExpression ExactOperator ParenthesizedExpression ProximityExpression OrExpression'
If I search for "andes" (as in the mountains) I get the same error.
I tried changing the value of OrOperator.Rule by adding a space after "or" like this:
OrOperator.Rule = Symbol("or ") | "|";
And it seems to work. So I did the same with "and". I'd be interesting in having this confirmed that I'm not misunderstanding how this works and thus causing problems.
Just wanted to thank you for this easy fix. Worked like a charm for me.
October 14, 2009 at 9:14 am
Again, I would like to point out that all these troubles with "or" and "and" prefixes should be gone if you use the latest version of Irony. There is also one big improvement in latest code drop of Irony - you can now try/test the search query converter directly from the Grammar Explorer test page. Download and use it please - and enjoy it!
October 15, 2009 at 12:35 pm
rivantsov (10/14/2009)
Again, I would like to point out that all these troubles with "or" and "and" prefixes should be gone if you use the latest version of Irony. There is also one big improvement in latest code drop of Irony - you can now try/test the search query converter directly from the Grammar Explorer test page. Download and use it please - and enjoy it!
I am using asp.net 2.0 with vs 2005. I was under the impression that the new stuff was 3.5.
If I am wrong...great. Just did not want to break what is working for me.
October 25, 2009 at 1:10 pm
If you you'd like to upgrade to the latest version of Irony, version 34726 Oct 13 2009, I did so with some code changes in Michael Coles code. The changes weren't major. In Irony, name spaces and method names were changed, so I updated Michael's code to reflect that.
First I download Irony[/url] and used irony-34726\Irony.Samples\FullTextSearchQueryConverter\SearchGrammar.cs to replace SearchGrammar.cs in Michael's project.
Next, (this is where my code will differ from Michael's, but you can follow it to make the needed changes) I had to change the way I called SearchGrammar. This is my code which you can use as a guide:
using System;
using System.Collections.Generic;
using Irony.Parsing;
using System.Data;
namespace Ronnie
{
public class Search
{
private static Parser _parser;
public static List<Ronnie.Link> DoSearch(string query) {
Ronnie.SearchGrammar grammar = new Ronnie.SearchGrammar();
if (_parser == null) _parser = new Parser(grammar);
ParseTree root = _parser.Parse(query.ToLower());
List<Ronnie.Link> links = new List<Ronnie.Link>();
if (root.Errors.Count == 0)
{
query = Ronnie.SearchGrammar.ConvertQuery(root.Root, Ronnie.SearchGrammar.TermType.Inflectional);
DataTable dt = Ronnie.Data.Search.Get(query);
foreach (System.Data.DataRow dr in dt.Rows)
{
links.Add(new Ronnie.Link(dr));
}
}
return links;
}
}
}
November 10, 2009 at 1:23 pm
While testing this against AdventureWorks, if I enter the complete text for title with a number for example Front Reflector Bracket and Reflector Assembly 3 it returns no results. Anything I am doing wrong?
Viewing 15 posts - 76 through 90 (of 166 total)
You must be logged in to reply to this topic. Login to reply