From 0cfd2be4f2d0739f75c6dfe4ec1bf7ec036533ae Mon Sep 17 00:00:00 2001 From: Paul Mesnilgrente Date: Thu, 5 Sep 2024 21:57:28 +0200 Subject: [PATCH] feat: added the possibility to have fulltext on without --- sunspot/lib/sunspot/setup.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sunspot/lib/sunspot/setup.rb b/sunspot/lib/sunspot/setup.rb index 45329fc56..af4087538 100644 --- a/sunspot/lib/sunspot/setup.rb +++ b/sunspot/lib/sunspot/setup.rb @@ -118,7 +118,9 @@ def setup(&block) # Return the Field with the given (public-facing) name # def field(field_name) - if field_factory = @field_factories_cache[field_name.to_sym] + if field_name.match? /_textv?$/ + text_fields(field_name.to_s.gsub(/_textv?$/, '').to_sym).first + elsif field_factory = @field_factories_cache[field_name.to_sym] field_factory.build else raise(