[Zope] ZCatalog: TextIndex and numbers

Casey Duncan casey@zope.com
Fri, 13 Sep 2002 12:11:22 -0400


The splitter (which is written in C for textindex) omits numbers. The cod=
e=20
that does this can be easily commented out though. Specifically this sect=
ion=20
of=20
{Zope}/lib/python/Products/PlugInIndexes/TextIndex/Splitter/ZopeSplitter/=
src/ZopeSplitter.c

    /*************************************************************
      Test whether a word has any letters.                       *
                                                                 */
    for (; --len >=3D 0 && ! isalpha((unsigned char)cword[len]); )
        ;
    if (len < 0 && ! self->index_numbers) {
        Py_INCREF(Py_None);
        return Py_None;
    }

    /*
     * If no letters, treat it as a stop word.
     *************************************************************/

Comment this out and a recompile, restart and reindex will get the number=
s=20
indexed.

ZCTextIndex in Zope 2.6 indexes numbers by default (Hands waving in air ;=
^).

hth,

-Casey

On Friday 13 September 2002 11:30 am, vsbabu@vsbabu.org wrote:
> Hello,
>=20
> I've a TextIndex on title (Zope 2.5.0). When the title has a value
>=20
> "Restoration Discretionary Programs--Sections 1135, 204, and 206"
>=20
> The index has the value=20
> ('restoration', 'and', 'programssections', 'discretionary')=20
>=20
> As you can see 1135, 204, 206 are not in the index. Is there a quick wa=
y
> to get ZCatalog to consider all words for indexing?
>=20
> Thanks
>=20
> -vsb
> http://vsbabu.org/
>=20
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -=20
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>=20