Re: SearchKit quiestion.
Re: SearchKit quiestion.
- Subject: Re: SearchKit quiestion.
- From: David Casseres <email@hidden>
- Date: Tue, 17 Mar 2009 12:03:08 -0700
Тимофей,
I am wondering what you consider irrelevant, if it is not simply a low
relevance score returned by SearchKit. If you have additional
criteria such that you need to make your own comparisons between the
query and the strings returned from SearchKit, then SearchKit may be a
waste of time for you.
David
On Mar 16, 2009, at 8:31 AM, Тимофей Даньшин wrote:
Hi all.
In my application I have to search for strings closest matching a
given string. So, for example, if the "given string" is "Hello.
Would you like some oranges", I need to find "Hello. Would you like
some lemons" or "Hello. Would you want some oranges" (if they are in
the database), and not just any phrase that contains the word
"oranges" or "would" or "hello", etc.
For this purpose I tried to use the SearchKit, and tried to filter
out the strings that were below a certain relevancy threshold and
compare the remaining ones to the "given string" using some other
methods. However, it turns out, that the bigger the database with
the strings gets, the more irrelevant strings i receive, and the
whole search process becomes quite slow.
And my question is, am I right in thinking that the SearchKit may
not be the solution that I want and I will have to write my own
indexing engine, or is it just that I am not using it right?
Here is how I create the index (the code was almost entirely taken
from a code example):
- (void) newIndexInFile {
NSURL * url = [NSURL fileURLWithPath: path];
NSString * name = @"SomeName";
if ([name length] == 0) name = nil;
SKIndexType type = kSKIndexInvertedVector;
NSNumber * minTermLength = [NSNumber numberWithInt: (int) 3];
NSSet * stopwords = [NSSet setWithObjects:
@"all",
@"and",
@"its",
@"it's",
@"the",
nil
];
NSDictionary * properties =
[NSDictionary dictionaryWithObjectsAndKeys:
@"", @"kSKStartTermChars",
@"-_@.'", @"kSKTermChars",
@"", @"kSKEndTermChars",
minTermLength, @"kSKMinTermLength",
stopwords, @"kSKStopWords",
nil
];
skIndex = SKIndexCreateWithURL(
(CFURLRef) url,
(CFStringRef) name,
(SKIndexType) type,
(CFDictionaryRef) properties
);
if (!skIndex) {
NSLog(@"SKIndex doesnt exist right after the creation");
}
}
Thank you for your attention.
Timofey.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden