it eigo 20101029

20
Full Text Search on iPhone Use OSS libraries on iPhone! わたなべかずひろ@kaz_29 2010118日月曜日

Upload: kazuhiro-watanabe

Post on 28-May-2015

484 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: It eigo 20101029

Full Text Search on iPhoneUse OSS libraries on iPhone!

わたなべかずひろ@kaz_29

2010年11月8日月曜日

Page 2: It eigo 20101029

Who am I

Name: Kazuhiro WatanabeWork: E2 Inc. => Here!twitter: @kaz_29blog: http://d.hatena.ne.jp/kaz_29I like #iphonedev #cakephp #lithium #php and #golf #cat and #beer!

2010年11月8日月曜日

Page 3: It eigo 20101029

Advertisement!

2010年11月8日月曜日

Page 4: It eigo 20101029

NIFTY Cloud Manager

2010/10/20 out! http://iphone.e-2.co.jp/

2010年11月8日月曜日

Page 5: It eigo 20101029

How to use ‘Hyper Estraier’ in your Apps.

http://fallabs.com/hyperestraier/

2010年11月8日月曜日

Page 6: It eigo 20101029

I like source install!

2010年11月8日月曜日

Page 7: It eigo 20101029

configure option

$ ./configure --prefix=/usr/local/iphone \

CC=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 \

CFLAGS=-arch i386

-isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk

-I/usr/local/iphone/include -L/usr/local/iphone/lib

CPP=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 \

AR=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ar

インストール先を指定2010年11月8日月曜日

Page 8: It eigo 20101029

configure option

$ ./configure --prefix=/usr/local/iphone \

CC=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 \

CFLAGS=-arch i386

-isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk

-I/usr/local/iphone/include -L/usr/local/iphone/lib

CPP=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 \

AR=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ar

Cコンパイラを指定2010年11月8日月曜日

Page 9: It eigo 20101029

configure option

$ ./configure --prefix=/usr/local/iphone \

CC=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 \

CFLAGS=-arch i386

-isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk

-I/usr/local/iphone/include -L/usr/local/iphone/lib

CPP=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 \

AR=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ar

Cコンパイル設定を指定2010年11月8日月曜日

Page 10: It eigo 20101029

configure option

$ ./configure --prefix=/usr/local/iphone \

CC=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 \

CFLAGS=-arch i386

-isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk

-I/usr/local/iphone/include -L/usr/local/iphone/lib

CPP=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 \

AR=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ar

C++コンパイラを指定2010年11月8日月曜日

Page 11: It eigo 20101029

configure option

$ ./configure --prefix=/usr/local/iphone \

CC=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 \

CFLAGS=-arch i386

-isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk

-I/usr/local/iphone/include -L/usr/local/iphone/lib

CPP=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 \

AR=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ar

アーカイブツールを指定2010年11月8日月曜日

Page 12: It eigo 20101029

Customize Makefile

# for Simurator

CC = /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2

AR = /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ar

CFLAGS = -arch i386 -Wall -fPIC -fsigned-char -O3 -fomit-frame-pointer \

 -fforce-addr

# for Device

CC = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2

AR = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar

CFLAGS = -isysroot /Developer-SDK402/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk \

-arch armv6 -Wall -fPIC -fsigned-char -O3 -fomit-frame-pointer -fforce-addr

2010年11月8日月曜日

Page 13: It eigo 20101029

Add your project

for device

for simulator

2010年11月8日月曜日

Page 14: It eigo 20101029

Summary

CC,CPP,AR => Change to iOS SDK Tools

CFLAGS

-arch i386(or armv6) => set target architecture

-isysroot => set root path

2010年11月8日月曜日

Page 15: It eigo 20101029

Test code - Preparation for search

/* dbをオープン */

if (!(db = est_db_open((const char*)cdataPath, ESTDBREADER, &ecode))){ return ;

}/* 検索条件オブジェクトを生成する */

cond = est_cond_new();

NSInteger length = sizeof(searchkey);/* 検索条件オブジェクトに検索式を設定する */

[searchBar.text getCString:(char*)searchkey maxLength:length encoding:NSUTF8StringEncoding];est_cond_set_phrase(cond, searchkey);

CBMAP *hints;hints = cbmapopenex(MINIBNUM);/* 実際に取得する数を設定 */

est_cond_set_max(cond, 30) ;

2010年11月8日月曜日

Page 16: It eigo 20101029

Test code - search and get results

/* データベースから検索結果を得る */

result = est_db_search(db, cond, &resnum, hints);/* ヒット数を取得 */

numHits = (rp = cbmapget(hints, "", 0, NULL)) ? atoi(rp) : resnum;

/* 各該当文書を取得して表示する */

for(i = 0; i < resnum; i++){/* 文書オブジェクトを取得する */

if(!(doc = est_db_get_doc(db, result[i], 0))) continue;if((tmptitle = est_doc_attr(doc, "@title")) != NULL) {

NSLog(@"Title: %s\n", tmptitle);}

}

2010年11月8日月曜日

Page 17: It eigo 20101029

Demo

2010年11月8日月曜日

Page 18: It eigo 20101029

Demo Data

10,796 html filestotal size 75M

PHP Manual

2010年11月8日月曜日

Page 19: It eigo 20101029

License is important!

2010年11月8日月曜日

Page 20: It eigo 20101029

Thank you(><)

2010年11月8日月曜日