lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Lybecker <and...@lybecker.com>
Subject Re: Error with maxClauseCount
Date Sun, 08 Apr 2012 05:58:16 GMT
Hi,

The SuperficieTotal and SuperficieCubierta fields are properly the
cause. Only store the precession needed for SuperficieTotal and
SuperficieCubierta fields - e.g. two decimals.

You can speed the searching and remove you problem by using TrieFields. e.g.

document.Add(new NumericField("SuperficieCubierta", 2,
reader.GetDecimal(18).ToString(), Field.Store.YES, true);

When searching use either the NumericRangeQuery <http://document.Add(new
NumericField("SuperficieCubierta", 2, reader.GetDecimal(18).ToString(),
Field.Store.YES, true);> or
NumericRangeFilter<http://lucene.apache.org/core/old_versioned_docs/versions/2_9_0/api/all/org/apache/lucene/search/NumericRangeFilter.html>.
The QueryParsers does not use these out of the box. You need to extend the
QueryParser by inherit and override the GetRangeQuery method - returning
either a NumericRangeQuery for the SuperficieTotal and
SuperficieCubierta fields
or standard functionality by calling base.GetRangeQuery.

:-)
Anders Lybecker

On Sat, Apr 7, 2012 at 11:14 PM, Leandro Halfon <leandrohalfon@gmail.com>wrote:

> Hi, i have 300.000 documents.
> I'm indexing the docs in this way:
>
>
> Document document = new Document();
>
>            document.Add(new Field("IDInmueble",
> reader.GetInt32(0).ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED));
>
>            document.Add(new Field("IDTipoOperacion",
> reader.GetInt32(1).ToString(), Field.Store.YES, Field.Index.ANALYZED));
>
>            document.Add(new Field("IDTipoInmueble",
> reader.GetInt32(2).ToString(), Field.Store.YES, Field.Index.ANALYZED));
>
>            document.Add(new Field("IDSubTipoInmueble",
> reader.GetInt32(3).ToString(), Field.Store.YES, Field.Index.ANALYZED));
>
>            document.Add(new Field("IDProveedor",
> reader.GetInt32(4).ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED));
>
>            document.Add(new Field("IDProvincia",
> reader.GetInt32(6).ToString(), Field.Store.YES, Field.Index.ANALYZED));
>
>            document.Add(new Field("IDCiudad", reader[7].ToString() !=
> string.Empty ? reader.GetInt32(7).ToString() : "-1", Field.Store.YES,
> Field.Index.ANALYZED));
>
>            document.Add(new Field("OtraUbicacion", reader.GetString(8),
> Field.Store.YES, Field.Index.NOT_ANALYZED));
>            document.Add(new Field("Titulo", reader.GetString(9),
> Field.Store.YES, Field.Index.NOT_ANALYZED));
>
>            document.Add(new Field("Moneda",
> reader.GetInt32(11).ToString(), Field.Store.YES, Field.Index.ANALYZED));
>
>            document.Add(new Field("Precio",
> reader.GetInt32(12).ToString(), Field.Store.YES, Field.Index.ANALYZED));
>
>            document.Add(new Field("PrecioConCambio",
> reader.GetDecimal(13).ToString(), Field.Store.YES, Field.Index.ANALYZED));
>
>            document.Add(new Field("IDTipoPrecio",
> reader.GetInt32(14).ToString(), Field.Store.YES, Field.Index.ANALYZED));
>
>            document.Add(new Field("Antiguedad",
> reader.GetInt32(15).ToString(), Field.Store.YES, Field.Index.ANALYZED));
>
>            document.Add(new Field("Ambientes",
> reader.GetInt32(16).ToString(), Field.Store.YES, Field.Index.ANALYZED));
>
>            document.Add(new Field("SuperficieTotal",
> reader.GetDecimal(17).ToString(), Field.Store.YES,
> Field.Index.NOT_ANALYZED));
>            document.Add(new Field("SuperficieCubierta",
> reader.GetDecimal(18).ToString(), Field.Store.YES,
> Field.Index.NOT_ANALYZED));
>
>            document.Add(new Field("TipoAnunciante",
> reader.GetInt32(19).ToString(), Field.Store.YES, Field.Index.ANALYZED));
>
>            document.Add(new Field("Url", reader.GetString(22),
> Field.Store.YES, Field.Index.NOT_ANALYZED));
>            document.Add(new Field("UrlFoto", reader.GetString(23),
> Field.Store.YES, Field.Index.NOT_ANALYZED));
>
>            document.Add(new Field("EstadoInmueble",
> reader.GetInt32(24).ToString(), Field.Store.YES, Field.Index.ANALYZED));
>            document.Add(new Field("IDRefExterno",
> reader.GetInt32(25).ToString(), Field.Store.YES,
> Field.Index.NOT_ANALYZED));
>
> Thanks!
>
>
> El 07/04/2012 14:21, "Anders Lybecker" <anders@lybecker.com> escribió:
>
> > Hi,
> >
> > Normally you shouldn't see this problem.
> >
> > How many documents do you have in you index?
> >
> > How are you indexing your documents?  Are you using TrieFields?
> >
> > Regards,
> > Anders Lybecker
> >
> > On Fri, Apr 6, 2012 at 6:18 PM, Leandro Halfon <leandrohalfon@gmail.com
> > >wrote:
> >
> > > Hi!
> > > I'm having an error with this clause.
> > > When i do a RangeQuery to filter values (price) beetwen 2 values i'm
> > having
> > > this error.
> > >
> > > How it works?
> > >
> > > Example:
> > > If i filter documents that have values between 0 and 4300, what value I
> > > should set to "maxClauseCount" ?
> > >
> > > Thanks!
> > >
> > > Leandro.
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message