Giter VIP home page Giter VIP logo

Comments (12)

mbriot avatar mbriot commented on July 17, 2024

cassandra field are case insensitive,

describe table flat3;

create your custom index like that :

CREATE CUSTOM INDEX flat3_index ON flat3 (lucene)
USING 'com.stratio.cassandra.lucene.Index'
WITH OPTIONS = {
'refresh_seconds' : '10',
'schema' : '{
fields : {
id : {type : "uuid"},
title : {type : "text"},
description : {type : "text"},
lastmodificationdate : {type : "date"}
}
}'
};

from cassandra-lucene-index.

jsebrien avatar jsebrien commented on July 17, 2024

Ok I forgot that, thanks. Also, I noticed, all indexed fields have to be set during insertion. Is there a way to insert rows with null columns, even if these columns are indexed? (it happens for a Longitude column, indexed as a part of a geopoint index)

from cassandra-lucene-index.

adelapena avatar adelapena commented on July 17, 2024

All single-field mappers allow null values, whereas multi-field mappers (geo_point, date_range and bitemporal) need all the fields to be present. However it seems a good idea to change this behavior. I think we could modify this kind of mappers to ignore rows with all columns with null value, e.g. ignore points with null latitude and null longitude. However, a row with a null latitude and a not null longitude should produce a failure. What do you think about this?

from cassandra-lucene-index.

jsebrien avatar jsebrien commented on July 17, 2024

Well, I would prefer if multi field mappers allow either:

  • null values for all its fields
  • or all its fields setted

In any other case (partially set fields), the mapper should produce a failure.

from cassandra-lucene-index.

adelapena avatar adelapena commented on July 17, 2024

The we agree. I will add this new behavior ASAP, probably this week. Thanks!

from cassandra-lucene-index.

jsebrien avatar jsebrien commented on July 17, 2024

This is great, thanks.

from cassandra-lucene-index.

adelapena avatar adelapena commented on July 17, 2024

Done! The changes are in master branch and they will be available in the next release.

from cassandra-lucene-index.

github-CodingUser avatar github-CodingUser commented on July 17, 2024

Hi

I am trying to do a case-insensitive search in stratio/lucene/cassandra.

Therefore, I created the index as below:

CREATE CUSTOM INDEX my_index ON my_table (lucene)
USING 'com.stratio.cassandra.lucene.Index.RowIndex'
WITH OPTIONS = {
'refresh_seconds' : '10',
'schema' : '{
fields : {
id : {type : "uuid"},
title : {type : "string", case_sensitive: false}
}
}'
};

However, if in my test instead of "TestTitle", I use "testTitle", it returns nothing.

I really appreciate if I get the information on how I can do a case_insensitive search.

from cassandra-lucene-index.

github-CodingUser avatar github-CodingUser commented on July 17, 2024

Hi

I am trying to do a case-insensitive search in stratio/lucene/cassandra.

Therefore, I created the index as below:

CREATE CUSTOM INDEX my_index ON my_table (lucene)
USING 'com.stratio.cassandra.lucene.Index.RowIndex'
WITH OPTIONS = {
'refresh_seconds' : '10',
'schema' : '{
fields : {
id : {type : "uuid"},
title : {type : "string", case_sensitive: false}
}
}'
};

However, if in my test instead of "TestTitle", I use "testTitle", it returns nothing.

I really appreciate if I get the information on how I can do a case_insensitive search.

from cassandra-lucene-index.

ealonsodb avatar ealonsodb commented on July 17, 2024

Hi @minauser,

Can you write down here the Keyspace creation, table creation and filter query please??

from cassandra-lucene-index.

github-CodingUser avatar github-CodingUser commented on July 17, 2024

Currently using 2.1.10 (Cassandra/Lucene)

CREATE CUSTOM INDEX my_index ON my_table (lucene)
USING 'com.stratio.cassandra.lucene.Index'
WITH OPTIONS = {
'refresh_seconds' : '10',
'schema' : '{
fields : {
id : {type : "uuid"},
name : {type : "string", case_sensitive: false}
}
}'
};

CREATE KEYSPACE IF NOT EXISTS my_keyspace WITH replication = {'class':'SimpleStrategy', 'replication_factor':1};

CREATE TABLE IF NOT EXISTS my_table(id uuid, name varchar, lucene TEXT, PRIMARY KEY(id)

INSERT INTO my_table(name, id) VALUES (“TestName”, "1c3d775f-d251-448f-9d51-5f3e0689ff0c") IF NOT EXISTS

SELECT name, id FROM my_table WHERE lucene = 'filter: { type: "match", field: "name", value: "TestName" }'

Returns 1 row BUT if I change the query to

SELECT name, id FROM my_table WHERE lucene = 'filter: { type: "match", field: "name", value: "testName" }'

Returns nothing!

from cassandra-lucene-index.

adelapena avatar adelapena commented on July 17, 2024

This will be answered at #62. @minauser, please don't copy-paste same message in three threads at a time, and don't mix your own issues with another not-related ones, specially if they are closed.

from cassandra-lucene-index.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.