SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: tokenizing vs. un_tokenizing and some aspects os quering

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


Permlink Replies: 14 - Pages: 1 - Last Post: Dec 27, 2011 3:55 AM Last Post By: Sophie
zielezin

Posts: 33
Registered: 2/7/07
tokenizing vs. un_tokenizing and some aspects os quering
Posted: Jan 18, 2008 11:05 AM
 
  Click to reply to this thread Reply
Hello,

Lets assume we hava a Category class:

@Searchable
public class Category{
@ SearchableId
private Long id;
@SearchableProperty
private String name;
// geters setters
}

We have 2 instances of this class stored in index:
Category - id:1 - name: "MacBook"
Category - id:2 - name: "MacBook Pro"

I want to find an instance of category where name matches exactly "MacBook".
I know that i can use @SearchableProperty(index=Index.UN_TOKENIZED) but in that case I would not be able to search in text queries by "macbook".
How to write using queryBuilder a query that means "a property of given class has exactly given value" no more no less.

I wrote a simple junit TestCase as an example.
If a Category is annotated with @SearchableProperty first 4 tests pass, if it is annotated with @SearchableProperty(index=Index.UN_TOKENIZED) last 2 tests pass.
What to do to make this test run without errors?

(libs: junit, compass, lucene)

Best regards,
Peter
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: tokenizing vs. un_tokenizing and some aspects os quering
Posted: Jan 22, 2008 3:16 PM   in response to: zielezin in response to: zielezin
 
  Click to reply to this thread Reply
You can use the term in queryBuilder.
zielezin

Posts: 33
Registered: 2/7/07
Re: tokenizing vs. un_tokenizing and some aspects os quering
Posted: Jan 23, 2008 4:23 AM   in response to: zielezin in response to: zielezin
 
  Click to reply to this thread Reply
Hi,

I am using term in query builder.
The problem is in case sensitive aspect of term method.
As mentioned above I got 2 categories with names "MacBook" and "MacBook Pro". I store them in index and then:

When I execute:
CompassQuery querry = session.queryBuilder().term("name", "MacBook").setTypes(new Class<?>[] {Category.class});
What creates query: "+name:MacBook +(alias:Category)" it returns 0 hits but expect first category to be returned.

The querry:
CompassQuery querry = session.queryBuilder().term("name", "MacBook Pro").setTypes(new Class<?>[] {Category.class});
+name:MacBook Pro +(alias:Category) also returns 0 hits but I expect second category to be returned.

Whats more:
CompassQuery querry = session.queryBuilder().term("name", "macbook pro").setTypes(
new Class<?>[] {Category.class});
Querry: "+name:macbook pro +(alias:Category)" returns 0 hits.

What I want to achieve is similar to sql queries:
select * from category where CATEGORY_NAME = 'MacBook'
select * from category where CATEGORY_NAME = 'MacBook Pro'
Is there a way to do this in Compass?

Best regards,
Peter
eugeis

Posts: 12
Registered: 3/30/08
Re: tokenizing vs. un_tokenizing and some aspects os quering
Posted: Apr 10, 2008 4:57 PM   in response to: zielezin in response to: zielezin
 
  Click to reply to this thread Reply
Hello,

did you find a solution?

I have same problem. If I set the property to UN_TOKENIZED and the content of property is case-sensitive, then the object is not found :-( by using of case-sensitive query or non case-sensitive query. I see in the index values are stored case-sensitive. I if set to TOKENIZED it works without problems by using case-sensitive or non case-sensitive search. I need the property UN_TOKENIZED, because I want to sort on the property.

I tried with Simple or Standard Analyzer.

Any ideas?

Thank you,

eugeis

lucene 2.3.1, compass 2.0M3
zielezin

Posts: 33
Registered: 2/7/07
Re: tokenizing vs. un_tokenizing and some aspects os quering
Posted: Apr 11, 2008 4:30 AM   in response to: eugeis in response to: eugeis
 
  Click to reply to this thread Reply
Hi,

I did something like this on some properties:

@SearchableMetaDatas({
@SearchableMetaData(name = "name_ut", index = Index.UN_TOKENIZED),
@SearchableMetaData(name = "name", index = Index.TOKENIZED)})
@SearchableProperty
public String name;

This makes two fields in index. Searching uses tokenized field and when I want to sort I use the other one explicitly.
It makes an index a bit bigger but it works;)
Some optimization on excluding from all property could be done on untokenized field also.

Best regards,
Peter
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: tokenizing vs. un_tokenizing and some aspects os quering
Posted: Apr 11, 2008 7:35 AM   in response to: zielezin in response to: zielezin
 
  Click to reply to this thread Reply
If you want to do sorting on multi value fields, this is a good solution. As suggested, I would exclude from all the un tokenized one.
Gorunus

Posts: 9
Registered: 7/20/10
Re: tokenizing vs. un_tokenizing and some aspects os quering
Posted: Jul 26, 2010 9:30 AM   in response to: zielezin in response to: zielezin
 
  Click to reply to this thread Reply
I use the same code but it does not really work!
	@Column(name = "tatouage")
	@SearchableProperty
	@SearchableMetaDatas({
	@SearchableMetaData(name = "tatouage_ut", index = Index.UN_TOKENIZED, store=Store.YES),
	@SearchableMetaData(name = "tatouage", index = Index.TOKENIZED)})
	public String getTatouage() {
I still get the exception field "tatouage_ut" does not appear to be indexed when I try addSort("tatouage_ut")
What am I doing wrong?
Gorunus

Posts: 9
Registered: 7/20/10
Re: tokenizing vs. un_tokenizing and some aspects os quering
Posted: Jul 27, 2010 4:52 AM   in response to: Gorunus in response to: Gorunus
 
  Click to reply to this thread Reply
I got it!
I wasn't searching by aliases!
_compassQuery.setAliases(strAliases);
did the trick for me! In fact, my field was well indexed but only in the alias of my test. The exception was thrown by another alias!
discount oakley...

Posts: 35
Registered: 8/20/11
Re: tokenizing vs. un_tokenizing and some aspects os quering
Posted: Aug 20, 2011 4:17 AM   in response to: zielezin in response to: zielezin
 
  Click to reply to this thread Reply
oakley sunglasses is one of the leading sports performance brands in the world. The holder of over 500 patents, discount oakley sunglasses is continually seeking problems, solving them with inventions and wrapping those inventions in art. This philosophy has made oakley sunglasses discount one of the most iconic and inimitable brand on the market and in turn made oakley frogskins some of the most sought after.welcome to our oakley sunglasses outlet. with big discount ,all oakley holbrook in lowest price.
reebok

Posts: 19
Registered: 9/17/11
Re: tokenizing vs. un_tokenizing and some aspects os quering
Posted: Sep 17, 2011 1:47 AM   in response to: zielezin in response to: zielezin
 
  Click to reply to this thread Reply
nike air max trademark symbol of the Greek goddess of victory, representing the wings feathers speed, but also represent the dynamic and gently. nike shox , design is a small hooks, modelling concise powerful, nasty like lightning, a see let people think of using the nike shoes uk produce speed and power.
azsxa

Posts: 158
Registered: 9/27/11
Re: tokenizing vs. un_tokenizing and some aspects os quering
Posted: Sep 27, 2011 2:54 AM   in response to: zielezin in response to: zielezin
 
  Click to reply to this thread Reply
Suche hop count can show the volumes The North Face request is increasing from October in every year.
happy2011

Posts: 41
Registered: 9/29/11
Re: tokenizing vs. un_tokenizing and some aspects os quering
Posted: Sep 29, 2011 2:47 AM   in response to: zielezin in response to: zielezin
 
  Click to reply to this thread Reply
HD Video Converter for Mac, professional HD converter on mac, provides you the functions of decording and encording HD videos, including:(HD) AVI, H.264/AVC, (HD) MPEG4 TS, (HD) MPEG2 TS, WMV HD, HD MOV, MKV, TS, DivX, RM, 3GP, MP4 etc. formats video.
DRM Removal,m4v converter for mac,remove drm,3gp converter,video converter for mac,mov to avi
azsxa

Posts: 158
Registered: 9/27/11
Re: tokenizing vs. un_tokenizing and some aspects os quering
Posted: Nov 2, 2011 2:19 AM   in response to: zielezin in response to: zielezin
 
  Click to reply to this thread Reply
Dear customers, welcome to our [url=http://www.bestuggbootsoutletshop.com/ugg-bailey-button-boots-c-279.html][b]ugg bailey button boots[/b][/url] Sale online store!Here you can find different kinds of [url=http://www.bestuggbootsoutletshop.com][b]ugg boots clearance[/b][/url] in various styles and colors. All our shoes [url=http://www.bestuggbootsoutletshop.com][b]ugg clearance[/b][/url] are in high quality at reasonable prices compared with other online stores. As a professional sale outlet, we have established good reputation in this business line. In addition, fine workmanship and exquisite material is guaranteed in our store. therefore,[url=http://www.bestuggbootsoutletshop.com][b]uggs clearance[/b][/url] as the most common fall and winter fashion accessories, not only warmth fills the air, but can also dress up your charm plus.We will also bear the loss of goods in the free shipping. Our aim is to offer the best service and convenience for our customers. we have various payment methods.There is no denying that [url=http://www.bestuggbootsoutletshop.com/ugg-kensington-c-317.html][b]ugg kensington[/b][/url] on sale will bring you unique modern style.
azsxa

Posts: 158
Registered: 9/27/11
Re: tokenizing vs. un_tokenizing and some aspects os quering
Posted: Nov 2, 2011 2:23 AM   in response to: zielezin in response to: zielezin
 
  Click to reply to this thread Reply
Dear customers, welcome to our ugg bailey button boots Sale online store!Here you can find different kinds of ugg boots clearance in various styles and colors. All our shoes ugg clearance are in high quality at reasonable prices compared with other online stores. As a professional sale outlet, we have established good reputation in this business line. In addition, fine workmanship and exquisite material is guaranteed in our store. therefore,uggs clearance as the most common fall and winter fashion accessories, not only warmth fills the air, but can also dress up your charm plus.We will also bear the loss of goods in the free shipping. Our aim is to offer the best service and convenience for our customers. we have various payment methods.There is no denying that ugg kensington on sale will bring you unique modern style.
Sophie

Posts: 55
Registered: 12/26/11
Re: tokenizing vs. un_tokenizing and some aspects os quering
Posted: Dec 27, 2011 3:55 AM   in response to: zielezin in response to: zielezin
 
  Click to reply to this thread Reply
Quicktime to WMV is a perfect Quicktime to WMV converting program which can perform all Quicktime formats to WMV like QT to WMV, M4V to WMV, Quicktime MOV to WMV, MP4 to WMV and even Quicktime HD video to WMV in high quality and speed. Also, you can convert quicktime to abundant devices like iPad, iPod, iPhone, Apple TV, PSP, Xbox, Google Phones/Android, General MP4 Player and 3GP mobile phones, etc.

More than a Quicktime to WMV Converter to convert Quicktime to WMV, it is also a wonderful converter accepting almost any video formats (SD and HD) and even 3D video formats; a versatile movie editor allowing to clip/merge/crop/add effects, watermark/ add subtiles and audio tracks, etc.

Convert Quicktime to WMV tool is faster than common video converter besause this converter has been upgraded with NVIDIA CUDA technology and AMD APP technology offering improved video encoding/decoding performance (HD videos in particular) for any computer running on CUDA-enabled GPU or AMD APP-enabled GPU. Using Quicktime to Windows Media Player Converter spares you more CPU resources and saves much time.

Capture Quicktime Video

Convert Quicktime Movies

Quicktime Compress

Quicktime to JPEG

Quicktime to WMA

Quicktime to MOV Converter

Quicktime to WMV for Mac

Edited by: Sophie on Dec 27, 2011 3:55 AM
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