Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ftsearch fails #1

Closed
ccoupe opened this issue Nov 24, 2016 · 10 comments
Closed

ftsearch fails #1

ccoupe opened this issue Nov 24, 2016 · 10 comments
Milestone

Comments

@ccoupe
Copy link
Member

ccoupe commented Nov 24, 2016

This chunk of code from @backorder fails somewhere in ftsearch (as many things do) but we have to start somewhere.

ccoupe pushed a commit that referenced this issue Nov 24, 2016
@IanTrudel
Copy link
Collaborator

ftsearch is broken and buggy. The Shoes manual is considerably bigger, so you may have better result with a bigger text file. I had already moved away from ftsearch in favour of Picky.

@ccoupe
Copy link
Member Author

ccoupe commented Nov 25, 2016

it seems Picky needs some sort of struct to index. Do you have that code or do we have to figure it out?

@IanTrudel
Copy link
Collaborator

it seems Picky needs some sort of struct to index.

Picky is building an index database to ensure a speedy search lookup. Shoes will have to prebuild this index database for Shoes Manual before each release, to let the end-users enjoy the manual without having to wait (e.g. fontconfig issue). We can write a Rake task for this purpose.

Do you have that code or do we have to figure it out?

I have to code somewhere. Let me get back to you on this one. It's however very easy: I simply replaced the ftsearch API calls with Picky, plus added some parameters to allow Picky to behave the same way Shoes Manual search was before.

@IanTrudel
Copy link
Collaborator

it seems Picky needs some sort of struct to index.

Oops. My apologies. I thought you were talking about the database.

The struct is used to build the search database. You can say, for example, each item is composed of a title and a description. Thereafter you can search by titles and/or descriptions.

@ccoupe
Copy link
Member Author

ccoupe commented Nov 25, 2016

Shoes will have to prebuild this index database for Shoes Manual before each release, to let the end-users enjoy the manual without having to wait (e.g. fontconfig issue). We can write a Rake task for this purpose.

I fixed the Windows fontconfig a release or two back in Shoes - now it uses Windows APIs to build the Shoes font list instead of the fc-cache/FONTCONFIG_FILE ugliness. - you can even have multiple Shoes installed without fighting over fontconfig. - or getting two paths stuck in the env var. The FONTCONFIG_FILE is no longer used. exe-shoes would not be possible without that fix.

When an author decides to 'publish' his ebook (create a .exe if he's running Windows) we can save the picky index then and include it in the merge of his Shoes and his ebook (app).

@IanTrudel
Copy link
Collaborator

Check your emails. I found the code for Picky to replace ftsearch. Should be working right out of the box but haven't tried lately. Enough to get you started anyway. Enjoy.

RE: fontconfig

Very glad to read about it.

When an author decides to 'publish' his ebook (create a .exe if he's running Windows) we can save the picky index then and include it in the merge of his Shoes and his ebook (app).

Agreed.

@IanTrudel IanTrudel added this to the 1.0.0 milestone Nov 25, 2016
@IanTrudel
Copy link
Collaborator

IanTrudel commented Nov 25, 2016

it seems Picky needs some sort of struct to index.

As a reference, the code I submitted to you through email, there is the structure you are looking for. Additionally, the members of the structure are used as searchable terms category :uri and category :body, id is always implied. Members of the structure not declared to Picky may not be searchable, it may not know how to retrieve it, hence a block is provided to Picky to process its member accordingly.

Document = Struct.new :id, :uri, :body

Picky

# ...
   category :uri, :from => lambda { |doc| doc.uri.dup }
   category :body, :from => lambda { |doc| doc.body.dup }
#...

@IanTrudel
Copy link
Collaborator

Additional references on Picky issue #142 and Picky issue issue #139.

@ccoupe
Copy link
Member Author

ccoupe commented Nov 26, 2016

Eventually. Hard coded paths. But it works.
manual

@ccoupe ccoupe closed this as completed Nov 26, 2016
@ccoupe
Copy link
Member Author

ccoupe commented Nov 26, 2016

Picky is working instead of ftsearch so I'm closing this issue. There can can be many issues. This one was narrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants