Click here to Skip to main content
15,893,487 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionSaving asp panel as image Pin
sudjp5-Apr-08 1:07
sudjp5-Apr-08 1:07 
Generalmaster page and java script validation Pin
krishnaveer4-Apr-08 23:16
krishnaveer4-Apr-08 23:16 
AnswerRe: master page and java script validation Pin
Ashish Sehajpal4-Apr-08 23:34
Ashish Sehajpal4-Apr-08 23:34 
GeneralRe: master page and java script validation Pin
krishnaveer5-Apr-08 0:35
krishnaveer5-Apr-08 0:35 
AnswerRe: master page and java script validation Pin
Ashish Sehajpal4-Apr-08 23:35
Ashish Sehajpal4-Apr-08 23:35 
GeneralRe: master page and java script validation Pin
Ashish Sehajpal6-Apr-08 20:04
Ashish Sehajpal6-Apr-08 20:04 
QuestionHow to use MATHML control Pin
yogesh_kumar_agarwal4-Apr-08 22:59
yogesh_kumar_agarwal4-Apr-08 22:59 
GeneralProblem with Russian Language in Lucene 2.1 Pin
Anna20084-Apr-08 21:40
Anna20084-Apr-08 21:40 
Hi all!
I am indexing Russian text with that code. I have a problem, when I try to search for words in different cases.
Search is productive, only if the word is in the same form, as in the initial (indexing) text. Help me please.
(Whether there can be it because Words in RussianStemmer.cs are stored in the coding KOI8-r?)
versions: Lucene.Net 2.0.0.4, Snowball.Net 2.0.0.1

using System;
using System.Collections.Generic;
using System.Text;
using Lucene.Net.Documents;
using Lucene.Net.Index;
using Lucene.Net.Analysis.Snowball;
using Lucene.Net.Search;
using Lucene.Net.QueryParsers;
using System.Text.RegularExpressions;
using Lucene.Net.Analysis;

class Program
{
static void Main(string[] args)
{
string index_path = @"D:\index\";
System.IO.StreamReader reader;
reader = new System.IO.StreamReader(new System.IO.FileStream(@"d:\source\67165.html", System.IO.FileMode.Open, System.IO.FileAccess.Read), System.Text.Encoding.Default);
reader = new System.IO.StreamReader(reader.BaseStream, reader.CurrentEncoding);
String title = Regex.Replace(reader.ReadLine(), "<[^>]*>", "");
String fullText = Regex.Replace(reader.ReadToEnd(), "<[^>]*>", "");
Document doc = new Document();
doc.Add(new Field("message_title", title, Field.Store.YES, Field.Index.TOKENIZED));
doc.Add(new Field("message_text", fullText, Field.Store.NO, Field.Index.TOKENIZED));
Analyzer a = new SnowballAnalyzer("Russian");
bool create_key = true;
IndexWriter iw = new IndexWriter(index_path, a, create_key);
iw.AddDocument(doc);
iw.Optimize();
iw.Close();

String query_string = "??????";
Search(query_string, index_path);
query_string = "??????";
Search(query_string, index_path);
query_string = "???????";
Search(query_string, index_path);
query_string = "????????";
Search(query_string, index_path);
Console.ReadKey();
}
static void Search(string query_string, string index_path)
{
Searcher search = new IndexSearcher(index_path);
Analyzer a = new SnowballAnalyzer("Russian");
QueryParser parser = new QueryParser("message_text", a);
Query q = parser.Parse(query_string);
Hits hits = search.Search(q);
string[] result = new string[0];
if (hits.Length() > 0)
{
result = new string[hits.Length()];
for (int i = 0; i < hits.Length(); i++)
{
result[i] = hits.Doc(i).GetField("message_title").StringValue();
Console.WriteLine("\n{0}. {1}\n", i + 1, result[i]);
}
}
else
{
Console.WriteLine("\n Missing Search!!!\n");
}
}
}


Russian text example (for indexing):
"?????? ???????? ? ?????? ????????? ??????? ?????????
radiomayak.ru
?? ? ??????. ??????? ?????? ??????? ?????? ????????. ???? ???????, ???? ?????????. ?? ???? "?????" ?? ???????? ??????? ??????????? ????????????? ????????????? ??? ??????? ??????.
??????: 25 ????? ?????? ???????? ?? ?????? ??????? - ??? ?????? ?????? ?????? ? ?????? ?????????????, ??????????? ?????? ???????, ?????? ??? ?????? ?? ???????? ??????? ? ???????? ??????? ????.
? 11:40 ?? ?????? ????????? ????????? ?????????? ? ???, ??? ???????????? ? ???? ???????? ???? ????????? ??-??? ?????. ?????? ????????? ??????? ?????????. ? 12:30 ?? ?????? ??????? ???????????? ????? ?????? ?????????? ??? ????????? ???????????? ?????? ????????."

forum
QuestionHi friends... Date Picker Problem Pin
G Nathan4-Apr-08 19:45
G Nathan4-Apr-08 19:45 
GeneralRe: Hi friends... Date Picker Problem Pin
That's Aragon4-Apr-08 20:49
That's Aragon4-Apr-08 20:49 
GeneralRe: Hi friends... Date Picker Problem Pin
N a v a n e e t h4-Apr-08 21:24
N a v a n e e t h4-Apr-08 21:24 
AnswerRe: Hi friends... Date Picker Problem Pin
Ashish Sehajpal4-Apr-08 21:34
Ashish Sehajpal4-Apr-08 21:34 
Questionexcel workbooks parameter problem Pin
Pankaj Garg4-Apr-08 18:52
Pankaj Garg4-Apr-08 18:52 
Questionregarding post back event Pin
vijaylumar4-Apr-08 18:45
vijaylumar4-Apr-08 18:45 
GeneralRe: regarding post back event Pin
N a v a n e e t h4-Apr-08 21:26
N a v a n e e t h4-Apr-08 21:26 
GeneralRe: regarding post back event Pin
Ashish Sehajpal4-Apr-08 21:37
Ashish Sehajpal4-Apr-08 21:37 
GeneralCustom Control Web Projects [modified] Pin
chaitramk4-Apr-08 18:45
chaitramk4-Apr-08 18:45 
GeneralRe: Custom Control Web Projects Pin
N a v a n e e t h4-Apr-08 21:27
N a v a n e e t h4-Apr-08 21:27 
GeneralInvalidating page contents Pin
Mohammad A Gdeisat4-Apr-08 12:06
Mohammad A Gdeisat4-Apr-08 12:06 
AnswerRe: Invalidating page contents Pin
Ashish Sehajpal4-Apr-08 21:27
Ashish Sehajpal4-Apr-08 21:27 
GeneralDatabind image from database Pin
Paul McGann4-Apr-08 10:44
professionalPaul McGann4-Apr-08 10:44 
GeneralRe: Databind image from database Pin
Ashish Sehajpal4-Apr-08 21:30
Ashish Sehajpal4-Apr-08 21:30 
QuestionHOW TO MAINTAIN DYNAMICALLY CREATED CONTROLS AFTER POSTBACK C# Pin
Phivos Stylianides4-Apr-08 10:14
Phivos Stylianides4-Apr-08 10:14 
AnswerRe: HOW TO MAINTAIN DYNAMICALLY CREATED CONTROLS AFTER POSTBACK C# Pin
Ashish Sehajpal4-Apr-08 23:43
Ashish Sehajpal4-Apr-08 23:43 
GeneralRe: HOW TO MAINTAIN DYNAMICALLY CREATED CONTROLS AFTER POSTBACK C# Pin
kontax5-Apr-08 2:54
kontax5-Apr-08 2:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.