Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #27179

Re: dbf.py API question concerning Index.index_search()

Date 2012-08-16 17:43 +0100
From MRAB <python@mrabarnett.plus.com>
Subject Re: dbf.py API question concerning Index.index_search()
References <mailman.3329.1345072870.4697.python-list@python.org> <502c4439$0$29978$c3e8da3$5496439d@news.astraweb.com> <502C4B3A.6000603@stoneleaf.us> <502C591E.2060700@mrabarnett.plus.com> <502D1C27.5050108@stoneleaf.us>
Newsgroups comp.lang.python
Message-ID <mailman.3380.1345135396.4697.python-list@python.org> (permalink)

Show all headers | View raw


On 16/08/2012 17:13, Ethan Furman wrote:
> MRAB wrote:
>> On 16/08/2012 02:22, Ethan Furman wrote:
>>> Steven D'Aprano wrote:
>>>> On Wed, 15 Aug 2012 16:26:09 -0700, Ethan Furman wrote:
>>>>
>>>>> Indexes have a new method (rebirth of an old one, really):
>>>>>
>>>>>    .index_search(
>>>>>       match,
>>>>>       start=None,
>>>>>       stop=None,
>>>>>       nearest=False,
>>>>>       partial=False )
>>>> [...]
>>>>
>>>> Why "index_search" rather than just "search"?
>>>
>>> Because "search" already exists and returns a dbf.List of all matching
>>> records.
>>>
>> Perhaps that should've been called "find_all"!
>
> In interesting thought.
>
> Currently there are:
>
>     .index(data)   --> returns index of data in Index, or raises error
>     .query(string) --> brute force search, returns all matching records
>     .search(match) --> binary search through table, returns all matching
>                        records
>
> 'index' and 'query' are supported by Tables, Lists, and Indexes; search
> (and now index_search) are only supported on Indexes.
>
What exactly is the difference between .index and .index_search with
the default arguments?

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

dbf.py API question concerning Index.index_search() Ethan Furman <ethan@stoneleaf.us> - 2012-08-15 16:26 -0700
  Re: dbf.py API question concerning Index.index_search() Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-08-16 00:52 +0000
    Re: dbf.py API question concerning Index.index_search() Ethan Furman <ethan@stoneleaf.us> - 2012-08-15 18:22 -0700
    Re: dbf.py API question concerning Index.index_search() MRAB <python@mrabarnett.plus.com> - 2012-08-16 03:21 +0100
    Re: dbf.py API question concerning Index.index_search() Ethan Furman <ethan@stoneleaf.us> - 2012-08-16 09:13 -0700
    Re: dbf.py API question concerning Index.index_search() MRAB <python@mrabarnett.plus.com> - 2012-08-16 17:43 +0100
    Re: dbf.py API question concerning Index.index_search() Ethan Furman <ethan@stoneleaf.us> - 2012-08-16 10:46 -0700
  Re: dbf.py API question concerning Index.index_search() Hans Mulder <hansmu@xs4all.nl> - 2012-08-16 12:34 +0200

csiph-web