# Searchlogic to check whether two arrays intersect

**URL:** <https://www.ruby-forum.com/t/searchlogic-to-check-whether-two-arrays-intersect/184016>\
**Category:** Rails\
**Created:** [February 23, 2010, 10:18pm UTC](https://www.ruby-forum.com/t/searchlogic-to-check-whether-two-arrays-intersect/184016 "2010-02-23T22:18:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Learn\_by\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e274bd/32.png) [@Learn\_by\_D](https://www.ruby-forum.com/u/Learn_by_D)\
**Post date:** [February 23, 2010, 10:18pm UTC](https://www.ruby-forum.com/t/searchlogic-to-check-whether-two-arrays-intersect/184016/1 "2010-02-23T22:18:38Z")

</div>

How can I use searchlogic to check whether two arrays intersect? I  
have User.array\_1[] and the search criteria are in Search.array\_2[].  
I want to search for all users whose has an array\_1[] that intersects  
with Search.array\_2[] . That is where (user.array\_1 &  
search.array\_2) != nil . How can I do this with searchlogic?  
Thanks.
