Mit freundlichen Grüßen
as i mentioned before i use swish-e c-library with the index files stored
I found out that this creates some different problems, because when
searching from cd-rom you have to avoid file access on all costs,
otherwise you will have a VERY slow performance.
Well, i am quite happy with the btree version here, because it helped me
to reduce search time from minutes to seconds. The problem is still the
missing "numerical" search, because the -L option is still quite slow.
In my application i have to do a number of single searches (e.g.
name=smith, city=boston, -L age 20 35) which have to be combined to an
overall result in the end. I have to do it this way, because people want
to know how many entry with name=smith are in the database, how many
entries with city=boston are in the database etc.
Up to now i searched for name=smith. Then i searched for city=boston. Then
i searched for name="YYYY" -L age 20 35, and finally i searched for
name=smith and city=boston -L age 20 35 to get the combined end result.
Well as i am still trying to speed up things i thought it should be
possible to make the "andresultlists" function available in the c-library.
So i should be able to skip the final search for the end result and just
"and" the single results together.
Here's what i tried to achieve this:
RESULTS_OBJECT *SwishAndResults(RESULTS_OBJECT *results1, RESULTS_OBJECT
db_results = results1->db_results;
db_results2 = results2->db_results;
//Doesn't work if this hasn't been done before calling andresultlists
db_results->resultlist = sortresultsbyfilenum(db_results->resultlist);
db_results2->resultlist = sortresultsbyfilenum(db_results2->resultlist);
//After andresultlists totalresults has still the old value
//so i have to get the new number of results
cur_result = db_results->resultlist->head;
//if i do this, it crashes when i try to access higher numbers in the
while ( cur_result )
cur_result = cur_result->next;
//so i have to call sortresults again
results1->total_results = sortresults( results1 );
I am not really happy with this solution, because it didn't have the
speedup effect i expected.
I think right now, this is because i have to sort the results threetimes.
Any suggestions anyone on
a) why i can't access the results when i fill total_results within the
b) how to avoid the sorting before and after the call to andresultlists?
Received on Thu Feb 24 01:26:07 2005