Mailing List Archive

r3752 - in trunk: c_src/KinoSearch c_src/KinoSearch/Index c_src/KinoSearch/Search perl perl/lib/KinoSearch perl/lib/KinoSearch/Docs perl/lib/KinoSearch/Index perl/lib/KinoSearch/Search
Author: creamyg
Date: 2008-08-23 18:31:31 -0700 (Sat, 23 Aug 2008)
New Revision: 3752

Added:
trunk/perl/lib/KinoSearch/Docs/DocNums.pod
Modified:
trunk/c_src/KinoSearch/Index/IndexReader.bp
trunk/c_src/KinoSearch/Index/MultiReader.bp
trunk/c_src/KinoSearch/Index/SegReader.bp
trunk/c_src/KinoSearch/Search/MultiSearcher.bp
trunk/c_src/KinoSearch/Search/Searchable.bp
trunk/c_src/KinoSearch/Searcher.bp
trunk/perl/MANIFEST
trunk/perl/lib/KinoSearch/Index/IndexReader.pm
trunk/perl/lib/KinoSearch/Search/Searchable.pm
trunk/perl/lib/KinoSearch/Searcher.pm
Log:
Expose IxReader_Fetch_Doc() and Searchable_Fetch_Doc() as public methods.
Add KinoSearch::Docs::DocNums documentation explaining that doc nums are
ephemeral.


Modified: trunk/c_src/KinoSearch/Index/IndexReader.bp
===================================================================
--- trunk/c_src/KinoSearch/Index/IndexReader.bp 2008-08-23 22:43:59 UTC (rev 3751)
+++ trunk/c_src/KinoSearch/Index/IndexReader.bp 2008-08-24 01:31:31 UTC (rev 3752)
@@ -5,11 +5,11 @@
* IndexReader is the interface through which Searchers access the content of
* an L<InvIndex|KinoSearch::InvIndex>.
*
- * IndexReader objects always represent a point-in-time of an invindex as it
- * existed at the moment the reader was created. If you want the search
+ * IndexReader objects always represent a point-in-time view of an invindex as
+ * it existed at the moment the reader was created. If you want search
* results to reflect modifications to an InvIndex, you must create a new
* IndexReader after the update process completes.
- *
+ *
* When a IndexReader is created, a small portion of the InvIndex is loaded
* into memory; additional sort caches are filled as relevant queries arrive.
* For large document collections, the warmup time may become noticable, in
@@ -122,9 +122,11 @@
public abstract incremented PostingList*
Posting_List(IndexReader *self, const CharBuf *field = NULL,
Obj *term = NULL);
- /** Retrieve the Doc for the given doc num.
+
+ /** Retrieve the stored fields for the given doc num, packaged as a HitDoc
+ * object. Throws an error if the doc num is out of range.
*/
- abstract incremented HitDoc*
+ public abstract incremented HitDoc*
Fetch_Doc(IndexReader *self, u32_t doc_num);

/** Retrieve the DocVector for the given doc num.

Modified: trunk/c_src/KinoSearch/Index/MultiReader.bp
===================================================================
--- trunk/c_src/KinoSearch/Index/MultiReader.bp 2008-08-23 22:43:59 UTC (rev 3751)
+++ trunk/c_src/KinoSearch/Index/MultiReader.bp 2008-08-24 01:31:31 UTC (rev 3752)
@@ -45,7 +45,7 @@
Posting_List(MultiReader *self, const CharBuf *field = NULL,
Obj *term = NULL);

- incremented HitDoc*
+ public incremented HitDoc*
Fetch_Doc(MultiReader *self, u32_t doc_num);

incremented DocVector*

Modified: trunk/c_src/KinoSearch/Index/SegReader.bp
===================================================================
--- trunk/c_src/KinoSearch/Index/SegReader.bp 2008-08-23 22:43:59 UTC (rev 3751)
+++ trunk/c_src/KinoSearch/Index/SegReader.bp 2008-08-24 01:31:31 UTC (rev 3752)
@@ -53,7 +53,7 @@
Posting_List(SegReader *self, const CharBuf *field = NULL,
Obj *term = NULL);

- incremented HitDoc*
+ public incremented HitDoc*
Fetch_Doc(SegReader *self, u32_t doc_num);

incremented DocVector*

Modified: trunk/c_src/KinoSearch/Search/MultiSearcher.bp
===================================================================
--- trunk/c_src/KinoSearch/Search/MultiSearcher.bp 2008-08-23 22:43:59 UTC (rev 3751)
+++ trunk/c_src/KinoSearch/Search/MultiSearcher.bp 2008-08-24 01:31:31 UTC (rev 3752)
@@ -47,7 +47,7 @@
Top_Docs(MultiSearcher *self, Query *query, u32_t num_wanted,
SortSpec *sort_spec = NULL);

- incremented HitDoc*
+ public incremented HitDoc*
Fetch_Doc(MultiSearcher *self, u32_t doc_num);

incremented DocVector*

Modified: trunk/c_src/KinoSearch/Search/Searchable.bp
===================================================================
--- trunk/c_src/KinoSearch/Search/Searchable.bp 2008-08-23 22:43:59 UTC (rev 3751)
+++ trunk/c_src/KinoSearch/Search/Searchable.bp 2008-08-24 01:31:31 UTC (rev 3752)
@@ -75,10 +75,10 @@
Top_Docs(Searchable *self, Query *query, u32_t num_wanted,
SortSpec *sort_spec = NULL);

- /** Return a HitDoc identified by the supplied doc num. Throws an error
- * if the doc num is out of range.
+ /** Retrieve the stored fields for the given doc num, packaged as a HitDoc
+ * object. Throws an error if the doc num is out of range.
*/
- abstract incremented HitDoc*
+ public abstract incremented HitDoc*
Fetch_Doc(Searchable *self, u32_t doc_num);

/** Return the DocVector identified by the supplied doc num. Throws an

Modified: trunk/c_src/KinoSearch/Searcher.bp
===================================================================
--- trunk/c_src/KinoSearch/Searcher.bp 2008-08-23 22:43:59 UTC (rev 3751)
+++ trunk/c_src/KinoSearch/Searcher.bp 2008-08-24 01:31:31 UTC (rev 3752)
@@ -40,7 +40,7 @@
Top_Docs(Searcher *self, Query *query, u32_t num_wanted,
SortSpec *sort_spec = NULL);

- incremented HitDoc*
+ public incremented HitDoc*
Fetch_Doc(Searcher *self, u32_t doc_num);

incremented DocVector*

Modified: trunk/perl/MANIFEST
===================================================================
--- trunk/perl/MANIFEST 2008-08-23 22:43:59 UTC (rev 3751)
+++ trunk/perl/MANIFEST 2008-08-24 01:31:31 UTC (rev 3752)
@@ -64,6 +64,7 @@
lib/KinoSearch/Docs/Cookbook.pod
lib/KinoSearch/Docs/Cookbook/CustomQuery.pod
lib/KinoSearch/Docs/Cookbook/WildCardQueryParser.pod
+lib/KinoSearch/Docs/DocNums.pod
lib/KinoSearch/Docs/FileFormat.pod
lib/KinoSearch/Docs/IRTheory.pod
lib/KinoSearch/Docs/Tutorial.pod

Added: trunk/perl/lib/KinoSearch/Docs/DocNums.pod
===================================================================
--- trunk/perl/lib/KinoSearch/Docs/DocNums.pod (rev 0)
+++ trunk/perl/lib/KinoSearch/Docs/DocNums.pod 2008-08-24 01:31:31 UTC (rev 3752)
@@ -0,0 +1,30 @@
+=head1 NAME
+
+KinoSearch::Docs::DocNums - Document numbers in KinoSearch are ephemeral.
+
+=head1 DESCRIPTION
+
+The document numbers used by KinoSearch are associated with a single invindex
+snapshot. The moment an invindex is updated, the mapping of document numbers
+to documents is likely to change.
+
+Since IndexReader objects represent a point-in-time view of an invindex,
+document numbers are guaranteed to remain static for the life of the reader.
+However, because they are not permanent, KinoSearch document numbers cannot be
+used as foreign keys, used to retrieve data from external databases.
+Furthermore, the order of document numbers does not tell you anything about
+the order in which documents were added to the index.
+
+If you truly need a primary key field, you must define it and populate it
+yourself.
+
+=head1 COPYRIGHT
+
+Copyright 2008 Marvin Humphrey
+
+=head1 LICENSE, DISCLAIMER, BUGS, etc.
+
+See L<KinoSearch> version 0.20.
+
+=cut
+

Modified: trunk/perl/lib/KinoSearch/Index/IndexReader.pm
===================================================================
--- trunk/perl/lib/KinoSearch/Index/IndexReader.pm 2008-08-23 22:43:59 UTC (rev 3751)
+++ trunk/perl/lib/KinoSearch/Index/IndexReader.pm 2008-08-24 01:31:31 UTC (rev 3752)
@@ -72,7 +72,7 @@
posting_list
max_docs
num_docs
-
+ fetch_doc
)]
},
}

Modified: trunk/perl/lib/KinoSearch/Search/Searchable.pm
===================================================================
--- trunk/perl/lib/KinoSearch/Search/Searchable.pm 2008-08-23 22:43:59 UTC (rev 3751)
+++ trunk/perl/lib/KinoSearch/Search/Searchable.pm 2008-08-24 01:31:31 UTC (rev 3752)
@@ -39,6 +39,7 @@
glean_query
max_docs
doc_freq
+ fetch_doc
get_schema
)],
},

Modified: trunk/perl/lib/KinoSearch/Searcher.pm
===================================================================
--- trunk/perl/lib/KinoSearch/Searcher.pm 2008-08-23 22:43:59 UTC (rev 3751)
+++ trunk/perl/lib/KinoSearch/Searcher.pm 2008-08-24 01:31:31 UTC (rev 3752)
@@ -36,6 +36,7 @@
collect
max_docs
doc_freq
+ fetch_doc
get_schema
get_reader )
],


_______________________________________________
kinosearch-commits mailing list
kinosearch-commits@rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch-commits