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

Add fuzzy search and custom analysis #7

Merged
merged 9 commits into from
Nov 23, 2015
Merged

Add fuzzy search and custom analysis #7

merged 9 commits into from
Nov 23, 2015

Conversation

bricesanchez
Copy link
Member

No description provided.

@bricesanchez
Copy link
Member Author

I'm working to fix the specs, it's not yet ready to be merged.

@bricesanchez
Copy link
Member Author

I'm not able to fix the tests, my last work is this :

# spec/features/index_context_spec.rb
require "spec_helper"


module Refinery
  describe "elasticsearch index", type: :feature do
    let(:home_page_title) { 'Home' }
    let(:home_page) { Page.create(title: home_page_title) }

    before do
      Elasticsearch.setup_index(delete_first:true)

      # Stub the menu pages we're expecting
      ::I18n.default_locale = Globalize.locale = :en
      allow(Page).to receive(:fast_menu).and_return([home_page])
    end

    context "on create" do
      it "displays the Home result" do
        visit refinery.elasticsearch_search_path(q: home_page_title)
        within "#search-results" do
          expect(page).to have_content(home_page_title)
        end
      end
    end

    context "on update" do
      let(:home_page_title_updated) { "#{home_page_title} updated" }

      before do
        home_page.update(title: home_page_title_updated)
      end

      it "displays the Home updated result" do
        visit refinery.elasticsearch_search_path(q: home_page_title_updated)
        within "#search-results" do
          expect(page).to have_content(home_page_title_updated)
        end
      end
    end
  end
end

I always have no results, i think elasticsearch doesn't now what is indexed

@bricesanchez
Copy link
Member Author

It's ready to be reviewed and merged :)

@bricesanchez
Copy link
Member Author

@datenimperator Do you have time to review this PR ?

datenimperator added a commit that referenced this pull request Nov 23, 2015
Add fuzzy search and custom analysis
@datenimperator datenimperator merged commit 7bf0afe into refinerycms-contrib:master Nov 23, 2015
@bricesanchez
Copy link
Member Author

Thanks !

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

Successfully merging this pull request may close these issues.

2 participants