A few questions:

1: How do I specify a string of indeterminate length in the pseudocode
at the bottom of this list? It will be a usability bug if I set
arbitrary limits on how long things can be?

2: What is the best way to store a list of strings as a field in a
database? (If need be I can have a delimiter-separated string, but I
want to know if there is a better method.)

My pseudocode is below; I want to be able to access a pseudocode SQL
of "Select all documents [in the following section] containing 1 or
more occurrences of words X, Y, and Z and order them by date last
seen."

On 3/25/06, Jonathan Hayward http://JonathansCorner.com
<[EMAIL PROTECTED]> wrote:
> I'm trying to retrofit SearchLog (
> http://jonathanscorner.com/etc/searchlog/ ) to use SQLalchemy
> mappings.
>
> SearchLog has at present the following major features:
>
> * Sections, each of which may contain 0 or more documents.
>
> * Documents, which have a complete text, a dictionary of occurrence
> frequency for each word, a list of tokens, and several
> get_fill_in_the_blank lookups that extract a field value, such as a
> last modified or last viewed value embedded in the text.
>
> It is heavily search oriented, and a typical search will search for
> all the documents containing keywords X, Y, and Z, sorted by "last
> viewed" date.
>
> While I dig into the documentation, I was wondering what
> comments/pointers you would have about retrofitting the backend: I
> want most of the program and its behavior to remain the same, while
> retrofitting an optimized SQLalchemy backend to make more efficient
> use of resources.

I've written pseudocode below:

        document_table = sqlalchemy.Table("document", \
          sqlalchemy.Column("file_contents", sqlalchemy.String), \
          sqlalchemy.Column("filename", sqlalchemy.String), \
          sqlalchemy.Column("html_name", sqlalchemy.String), \
          sqlalchemy.Column("last_modified", sqlalchemy.Datetime), \
          sqlalchemy.Column("last_viewed", sqlalchemy.Datetime), \
          sqlalchemy.Column("permanent_ID", sqlalchemy.String),
          sqlalchemy.Column("relative_filename", sqlalchemy.String), \
          sqlalchemy.Column("root", sqlalchemy.String), \
          sqlalchemy.Column("section", sqlalchemy.String), \
          sqlalchemy.Column("text", sqlalchemy.String), \
          sqlalchemy.Column("title", sqlalchemy.String), \
          sqlalchemy.Column("tokens", sqlalchemy.String), \
          sqlalchemy.Column("version", sqlalchemy.Integer), \
          )
        histogram_table = sqlalchemy.Table("histogram", \
          sqlalchemy.Column("permanent_ID", sqlalchemy.String), \
          sqlalchemy.Column("word", sqlalchemy.String), \
          sqlalchemy.Column("count", sqlalchemy.Integer),
          )
        histogram_total_table = sqlalchemy.Table("histogram_total", \
          sqlalchemy.Column("permanent_ID", sqlalchemy.String), \
          sqlalchemy.Column("count", sqlalchemy.Integer),
          )
        aliases_table = sqlalchemy.Table("aliases", \
          sqlalchemy.Column("old", sqlalchemy.String), \
          sqlalchemy.Column("new", sqlalchemy.String) \
          )
        # identifier is primary key
        section_table = sqlalchemy.Table("section", \
          sqlalchemy.Column("documents", LIST_OF_DOCUMENT_PRIMARY_KEYS), \
          sqlalchemy.Column("html_name", sqlalchemy.String), \
          sqlalchemy.Column("identifier", sqlalchemy.String), \
          sqlalchemy.Column("parent", sqlalchemy.String), \
          sqlalchemy.Column("root", sqlalchemy.String),
          sqlalchemy.Column("subsections", LIST_OF_IDENTIFIER_PRIMARY_KEYS), \
          #sqlalchemy.Column("text_patterns_to_accept", LIST_OF_STRINGS), \
          #sqlalchemy.Column("text_patterns_to_deny", LIST_OF_STRINGS), \
          sqlalchemy.Column("url_prefix", sqlalchemy.String), \
          sqlalchemy.Column("url_root", sqlalchemy.String),
          )



--
++ Jonathan Hayward, [EMAIL PROTECTED]
** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at http://JonathansCorner.com

** If you'd like a Google Mail (gmail.com) account, please tell me!


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to