Picon

How do I add a new xappy database? (Also extending search flags)


Problem1.
I have about 500,000 reports stored in a sqlite database.
I search with a Xappy index.

Rather than back-up all 500,000 reports + new ones (about 40,000 year)
I want to just archive past records and only back-up the current
sqlite database and current xappy index.

I want to do my search on 2 databases  (archive + current)
Thus I want to open the "current" database and add the "archvive"
database.
ie add_database() from within xappy

I have not been able to figure out how to add a new database.

(conn._index.add_database('current') did not work because
_index.add_database() did not like the parameter 'current')

Problem 2.  Extending search flags  - SOLVED

 I wanted to extend the flags when I parse a query.

    def _query_parse_with_fallback(self, qp, string, prefix=None):
        """Parse a query with various flags.

        If the initial boolean pass fails, fall back to not using
boolean
        operators.

(Continue reading)

Richard Boulton | 9 Jan 11:00

Re: How do I add a new xappy database? (Also extending search flags)


On Thu, Jan 08, 2009 at 09:19:13PM -0800, stuartgall@... wrote:
> I have not been able to figure out how to add a new database.
> 
> (conn._index.add_database('current') did not work because
> _index.add_database() did not like the parameter 'current')

Probably the easiest way is to open a connection for the current database,
call it "currentconn", and do:

conn._index.add_database(currentconn._index)

However, note that this isn't an "officially supported" technique: in
particular, it will give the wrong results if the configuration of the
current database is not identical to the main database.

--

-- 
Richard

Picon

Re: How do I add a new xappy database? (Also extending search flags)


That works - Thanks

On Jan 9, 9:00 pm, Richard Boulton <rich...@...>
wrote:
> On Thu, Jan 08, 2009 at 09:19:13PM -0800, stuartg...@... wrote:
> > I have not been able to figure out how to add a new database.
>
> > (conn._index.add_database('current') did not work because
> > _index.add_database() did not like the parameter 'current')
>
> Probably the easiest way is to open a connection for the current database,
> call it "currentconn", and do:
>
> conn._index.add_database(currentconn._index)
>
> However, note that this isn't an "officially supported" technique: in
> particular, it will give the wrong results if the configuration of the
> current database is not identical to the main database.
>
> --
> Richard

Gmane