SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: deletion from lucene index question

This question is not answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 27 - Pages: 2 [ 1 2 | Next ] - Last Post: Dec 7, 2011 1:36 AM Last Post By: bangzhunihao
Los Morales

Posts: 126
Registered: 10/2/06
deletion from lucene index question
Posted: Jun 23, 2007 11:25 AM
 
  Click to reply to this thread Reply
I'm running into an issue where one of the administrators here deleted data (that is Lucene-indexed) directly from the DB without notifying me. Now I have data in the Lucene index that does not have the corresponding data in the DB. I can find the primary keys for the records that were deleted. My question is, knowing these primary keys, and knowing that I store (but not index) these keys in the Lucene index, can I just create "dummy" objects, populate them with their primary keys, and pass these dummy objects to Compass for it to delete in the Lucene index? Or are there better scenarios? Thanks in advanced!

-los
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: deletion from lucene index question
Posted: Jun 23, 2007 12:44 PM   in response to: Los Morales in response to: Los Morales
Helpful
  Click to reply to this thread Reply
Sure, this will work. You don't even need to create dummy objects, you can simply pass the ids to the delete method (if you have more than one id, you can pass an array of ids) with the appropriate alias.
Los Morales

Posts: 126
Registered: 10/2/06
Re: deletion from lucene index question
Posted: Jun 23, 2007 5:04 PM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
Hi Shay,

Will it also due cascade deletes on the root's relationships? For example:

Book 1->n Chapters

If I delete book id = 1 via Compass by passing in the id, will it also delete all Chapters indexed associated with book id = 1?

-los
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: deletion from lucene index question
Posted: Jun 25, 2007 12:14 PM   in response to: Los Morales in response to: Los Morales
 
  Click to reply to this thread Reply
It depends on several things. Lets take some scenarios:

1. The relationship is component one (with Chapters root set to false): Yes, the Chapters will be deleted since they are embedded in the Book Resource.
2. Relationship is reference or the Chapters also stand on their own: Chapters won't be deleted. If you have defined cascading deletes, they will get deleted if the list is initialized with Chapters (and only its ids).

You still have another option of deleting the Chapter by theirs ids as well directly.
Los Morales

Posts: 126
Registered: 10/2/06
Re: deletion from lucene index question
Posted: Jun 27, 2007 10:25 AM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
Hi shay,

I'm currently running into this exception:

[i][b]org.compass.core.converter.ConversionException: Trying to load class with [5] while has ids mappings of [1][/b][/i]

My test code is fairly simple:

*********************************************
Long[] ids = new Long[5];
for (int k = 0; k < ids.length; k++) {
ids[k] = (long)k;
}

compassSession.delete(Book.class, ids);
********************************************

I know in the index there are Books with ids from 1 to 10 ($/Book/id).

Any suggestions? Thanks in advance.

-los
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: deletion from lucene index question
Posted: Jun 28, 2007 8:02 AM   in response to: Los Morales in response to: Los Morales
 
  Click to reply to this thread Reply
The support for passing an array is not for array of *different* Book instances, but the ability to pass an array of ids that are defined in Book. An example would simplify this:

Book {
id1;
id2;
}

Then, you can pass an array with the values of id1 and id2.

If you want to remove different instances of Book use several calls to delete (each with different value in the index).
discount oakley...

Posts: 35
Registered: 8/20/11
Re: deletion from lucene index question
Posted: Aug 20, 2011 4:19 AM   in response to: Los Morales in response to: Los Morales
 
  Click to reply to this thread Reply
Looking attractive and smart in the fingers of the other people has been the aspiration for any ladies. In order to get noticed instantly, pandora jewelry have the new philosophy of out standing fashion quality.So what is the best choice for you to show yourself .The answer is pandora bracelets.Full of colorful pandora charms can take you different visual effects. The Pandora range of rings is a wealth of beautiful gemstones and precious metals combined with fabulous design.So choose our pandora beads to witness the eternity and originality. pandora jewelry sale store offer pandora bracelets and pandora charms,choose varieties of cheap pandora charms from pandora bracelets sale outlet.up to 70% discount.
hmq123

Posts: 449
Registered: 8/22/11
christian louboutin
Posted: Aug 24, 2011 10:21 PM   in response to: Los Morales in response to: Los Morales
 
  Click to reply to this thread Reply
How christian louboutin should I heard cheap louboutin shoes that, about your right discount christian louboutin shoes and wrong? How Christian Louboutin Pumps should I heard, was able to Christian Louboutin Ankle Boots smile? How should I heard, you good, for her not to let the http://www.louboutinsshoes2u.com/ tears?
hmq123

Posts: 449
Registered: 8/22/11
Louboutins Shoes Sale
Posted: Aug 24, 2011 10:24 PM   in response to: Los Morales in response to: Los Morales
 
  Click to reply to this thread Reply
Fresh Louboutins Shoes Sale sweet smile like the Christian Louboutin Shoes wine you drink, the more Cheap Christian Louboutin mellow Christian Louboutin Glitter Pumps life, elegant lingering smile Cheap Louboutin Booties like read the poem, the more http://www.louboutinsshoes4sale.com/ romantic life.
hmq123

Posts: 449
Registered: 8/22/11
Discount Christian Louboutin Shoes
Posted: Aug 24, 2011 10:26 PM   in response to: Los Morales in response to: Los Morales
 
  Click to reply to this thread Reply
A smile Discount Christian Louboutin Shoes is healthy, the smile Christian Louboutin Shoes is success, but only Christian Louboutin sale smile and life, and life Cheap Wedding Shoes road to the colorful, just Christian Louboutin Ankle Boots won't give his life with http://www.cheap-christianlouboutinpumps.com/ regrets.
hmq123

Posts: 449
Registered: 8/22/11
Cheap Louboutins
Posted: Aug 24, 2011 10:28 PM   in response to: Los Morales in response to: Los Morales
 
  Click to reply to this thread Reply
A smile is the most Cheap Louboutins moving people expression, Christian Louboutin Shoes life is good and silent Christian Louboutin Discount language, only smile Christian Louboutin Wedding life, the Louboutin Open-toe Booties mood will be relaxed and http://www.cheaplouboutins-shop.com/ cheerful.
hmq123

Posts: 449
Registered: 8/22/11
christian louboutin sale
Posted: Aug 24, 2011 10:30 PM   in response to: Los Morales in response to: Los Morales
 
  Click to reply to this thread Reply
In middle christian louboutin sale age, experience christian louboutin shoes rains and winds, have discount louboutin sale seen the rainbow. Through Christian Louboutin Peep Toe Pumps pain, also get the Christian Louboutin Sandal Booties joy. Experienced setbacks, and bear witness to the http://www.discountlouboutins-sale.com/ success.
hmq123

Posts: 449
Registered: 8/22/11
New Moncler Jackets
Posted: Aug 24, 2011 10:33 PM   in response to: Los Morales in response to: Los Morales
 
  Click to reply to this thread Reply
Self-confidence New Moncler Jackets is not conceit, it is not proud, New Moncler Coats is important, Moncler Online Store is the spiritual pillar of the Cheap Moncler Men Jackets behavior of the Moncler Jackets Women self, self motivation is the incentive to overcome difficulties reach the goal of http://www.moncler-officialwebsite.com/ energy.
heidan

Posts: 4
Registered: 9/2/11
christian louboutin sale
Posted: Sep 2, 2011 6:13 AM   in response to: Los Morales in response to: Los Morales
 
  Click to reply to this thread Reply
Open any one gossip magazine or fashion magazine, or on the discussion boards, christian louboutin sale web logs to see the moment up to the decayed red shoes brand-Christian Louboutin, both big and small stars at a variety of brand shoes will wear Louboutin , from the classic small round satin paint to color paint to the latest open-toed sandals.chrsitian Louboutin Outlet to wearing fluorescent green Converse sneakers hanging shoulder bag, opening Vespa motorcycle trip he does not find inspiration from the fashion,this is definitely his identity theft.christian louboutin shoes Red like as a recognizable brand name. The rest of the philosophical question is, if there is no red soles.
heidan

Posts: 4
Registered: 9/2/11
Re: deletion from lucene index question
Posted: Sep 2, 2011 6:14 AM   in response to: Los Morales in response to: Los Morales
 
  Click to reply to this thread Reply

Open any one gossip magazine or fashion magazine, or on the discussion boards, christian louboutin sale web logs to see the moment up to the decayed red shoes brand-Christian Louboutin, both big and small stars at a variety of brand shoes will wear Louboutin , from the classic small round satin paint to color paint to the latest open-toed sandals.chrsitian Louboutin Outlet to wearing fluorescent green Converse sneakers hanging shoulder bag, opening Vespa motorcycle trip he does not find inspiration from the fashion,this is definitely his identity theft.christian louboutin shoes Red like as a recognizable brand name. The rest of the philosophical question is, if there is no red soles.

Legend
Guru: 2001 + pts
Expert: 501 - 2000 pts
Super-star: 101 - 500 pts
Assistant: 51 - 100 pts
Participant: 0 - 50 pts
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums